Code Apps using Claude Code – Power Platform

As straight forward as the title is deploying Code Apps from the start. If you are in Power Platform already, here’s where the evolution is from –

  1. Model-Driven Apps [Traditional Power Platform / Dynamics 365 CRM forms and View, Sitemaps and all of that you’ve known so far]
  2. Canvas Apps – Close to a decade to blend the experience of Power Point but to build Apps that connect to data sources and design things the way you like.
  3. Code Apps – [Build Practically Anything, sits in Power Platform]

I have a 2-blog series to explain Code Apps and I’ll continue to enrich this blog as a placeholder for Code Apps and making it easy for you to follow through and get your first one out even if you feel you are too late –

  1. Code Apps for Dataverse – Part 1 [Using VS Code and Claude Code] – Getting Started
  2. Code Apps for Dataverse – Part 2 [Updating your Apps and Deployment]

    And also check Power Platform experience to Vibe-Code your Code Apps without really leaving the Power Platform experience at all – Power Apps Vibe Coded Experience [Preview]

Hope this was helpful!

Here are some Power Automate posts you want to check out –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you

Advances and Retainers in Project Operations

Below is how you can setup Advanced and Retainers – and what is this in simple terms?

  1. Pre-Bill the Customer upfront.
  2. Reconcile the Billing amount before the next Billing cycle.
  3. If under-utilized or till the Amount, 0 is billed on.
  4. If over-utilized, the overage is billed to the customer on the Invoice created on Contract.

Setup Contract for Retainer Schedule

On the Contract for a combination of T&M and Fixed Price Contract Line, here’s how I setup the Retainer Schedule –

  1. Here are the Line Items on the Project Contract tied to the same project.

  2. And on the Contract, you have Advanced and Retainers Setup already.

  3. Here, you have the option to Setup the schedule.


  4. When you click on Setup a retainer schedule, it’ll ask you to fill out the details. You can either select and End Date for the Retainer of no. of Retainer Invoices to be created.
    But, the message isn’t shown till you realize it after you enter both.


    And when I tried to enter this – it gave me an error.

  5. So, I just kept the End Date

  6. And it’ll create the Schedule for me.

    Now, this is set.

Invoice the Retainers

Now, the Retainer Schedule is ready, let’s Invoice and confirm the Invoice –

  1. I can select the Retainer line and click on Ready to Invoice.

  2. Once this is ready, I can create the Invoice from the Contract.

  3. Once the Invoice is created, you’ll see that the Advances and Retainers section shows the Invoiced line item.
    Now, you confirm this Invoice.


  4. Once the Invoice is confirmed, this amount is available to be used on the Contract.


Consuming the Retainers

Now, this amount is available for us to consume on the Project. Let’s pre-date the Time Entries to see how the Available Amount is consumed –

  1. These are my time entries. And I’ll submit them.

  2. The Project Approver approves them so that Actuals are created which can be made as Ready to Invoice.


    Now, the Unbilled Sales will be made as Ready to Invoice.

  3. Now, as usual – Invoice will be created without doing anything to the Contract Retainer setup.

  4. Now, the Pro-forma Invoice will be created and the Amount is seen on the Line Items of what was Ready to Invoice but the Invoice amount itself will be 0.

  5. If you scroll to the bottom of the Invoice, you’ll see the Balance remaining due to this Invoice.

  6. Now, you confirm the Invoice.

  7. And once the Invoice is Confirmed, the Used Amount on the Contract’s Retainer schedule will be updated.


    If you over use the balance, the upcoming Invoice will have less amount to be billed based on what’s available.

Hope this was helpful!

Here are some Power Automate posts you want to check out –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you

Code Apps for Dataverse – Part 2 [Updating your Apps and Deployment]

Now that we learnt how to get started and put up your first blank app in Code Apps for Dataverse – Part 1 [Using VS Code and Claude Code] – Getting Started. In this post, we ‘ll understand how you can continue to work with your Code Apps like you would for any other solutions in Dataverse.

Pushing your App to the Environment

Now that Code Apps was run locally and hosted on the environment. We’ll see how it is coming along –

  1. Code Apps was running on Localhost as we saw in the previous post. You can always use the command pa app run to test this and it’ll give you a URL which on the browser of your environment will appear like this –


  2. Now, you can check if this is published or not by running pa app list


  3. And then, you’ll be able to push this to the environment itself.
    First, npm run build and then pa app push
    This will first build the app locally and then push it to the environment.


  4. Here, the App is now pushed to your preferred Solution which you have set for your evironment.

    Now, the App is on the environment and can be run from there.

Update Your Changes

Now that the App is deployed, I’ll continue to make more changes to it –

  1. Just chat with Claude Code and build your App first. Like so –

  2. Once all the changes are written – you can run pa app run to run the App server locally.


  3. Now, once you copy the URL it gave back – basically the same one which is generated for localhost.
    It’ll now show the changes you did.



  4. And then again, push the changes to the environment. Using the same commands –
    npm run build
    pa app push

Running the App on the Environment

We have not run it locally, let’s run it on the environment –

  1. Locate your App like you would do for any Canvas/Model-Driven app and you can simply Run it.

  2. But here, something is wrong – it didn’t load my app. Maybe something is missing and I need to debug. Correct?

    This segways into debugging mode.

Debug the App on the Environment

Now, let’s debug the App on the environment –

  1. Simply chat with Claude Code explaning the issue. Follow the instructions based on what it says and every time the App is updated, run npm run build and then pa app push to keep pushing your changes to the environment and keep checking.

And that’s pretty much how you go about it.

Hope this was helpful!

Here are some Power Automate posts you want to check out –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you

Code Apps for Dataverse – Part 1 [Using VS Code and Claude Code] – Getting Started

Code Apps has been our earlier this year and I’ve seen people start to use it already. But some stumble upon it and somehow end up creating and managing it – but when we try to remember where we started, it get a little blurry.

Also, this is great segway to move to something not Microsoft-native from a development standpoint and moving away from using Visual Studio (traditionally for C# .NET Framework Plugins) to Node.js based vibe-coded Code-App development.
So, we’ve come from Model-driven Apps -> Canvas Power Apps -> now Code Apps!

Let’s get your first Code Apps out of th door.

Enable Code Apps in your Power Platform Environment

Given you might be a Power Platform / Dynamics 365 Admin already, go to the your Environment’s Settings as below –

  1. Look for Features –

  2. Then, Code Apps might already be Disabled, you need to Enable it.

  3. Make sure to Save the settings and check if it is enabled.


    That’s it, you’re set. Now let’s get your environment setup.

Setup your VS Code with with Node.js [and Claude Code] to start writing your Code App

Suppose you are using VS Code [the most popular choice for coding lately 😊, or vibe-coding with Claude Code], here’s how you set it up –

  1. Make sure Node.js is setup on your machine post. Check it using Claude Code on Visual Studio.
    Use “node –version” to check the installation is in place.


    In case Node.js is not installed – on a Mac, use Homebrew to get it or from winget on a Windows machine.


  2. That set up, now – Power Apps CLI or “pac cli” for short.
    So, check using pac –version
    I’ll ignore the rest of the message for now.


  3. Now, my preference is to build locally and then host it on the environment. So, my next step is – to authenticate Power Platform CLI to the target environment.


    One of the ways to authenticate Power Apps CLI is to also use Device Login method. In that case, use the below –


  4. Use pac org who to confirm if you are authenticated into the correct environment.


    Here, you are set with your tools. Now, let’s create a project locally.

Setup A Local App Folder

Now, let’s setup a local app folder now that your tools are authenticated and ready.

  1. Run the command to create a Project folder locally and name your app.

  2. Now, once I run this in Terminal on my VS Code, it’ll create the App.


  3. As this looks good, I’ll now go ahead and initialize this in my connected environment.
    Using this command pa app init --display-name "Project Profitability Dashboard" --environment-id XXXXXX-XXXX-e9d2-8c94-e577a72007d7
    Once you run it in your terminal, it’ll give you this on your browser

  4. Confirm the local build using ls command.

    You’ll see the files listed. Now you are all set.

Add Data Source to the Code App

Now, let’s add Data Source to the code App. In this case, it’ll be our Dataverse environment itself –

  1. Use this command pa app add data-source shared_commondataserviceforapps to add the Data source. I’m not using a Connection Reference so it just took my Entra ID.


  2. And I select the connector, it’ll be finally connected. Now, since this is a blank project, just add a dev script using npm install --save-dev vite

  3. It’ll create the same code and you are done. Now, you can continue to talk to Claude Code to build your Code App and run it using pa app run


    Now, we’ll see how the App can run and your changes can start panning out!
    Part 2 – Code Apps for Dataverse – Part 2 [Updating your Apps and Deployment]

Hope this was helpful!

Thank you