Posts

PowerApp to validate UK VAT Numbers in D365 F&O

Image
 In my last post I showed you how to create a custom connector to validate a UK VAT number to use in PowerAutomate, in this post I am going to go through how to actually use that custom connector in a PowerApp which we can imbed in D365 F&O, in future posts I will also look at other ways you can use this API for automatic validation. The first element is the flow which I am using which is pretty straight forward. We use an in PowerApps step which I am using to initialize the the only parameter required to trigger the API from HMRC using the custom connector I placed in the previous post. Then I am setting the returned VRN number as a variable. I then initialize a variable called validVRN which basically will hold the text back to the PowerApp and I do a compare too see if the VRN from the PowerApp is the same as the returned value from the API, then I set the value on the variable to either "Valid" or "Not Valid" Then because a blank value can result in a Valid ...

Custom Connector for HMRC VAT Number Validation

Image
I was scrolling through available API's on HMRC website and noticed this one which is in BETA: Check a UK VAT number - HMRC Developer Hub - GOV.UK This information would be very useful in PowerApps and also F&O, so I decided to create a custom connector around this API. To do this I went to custom connectors section in PowerApps: Then I clicked on New Custom Connector > Create from Blank. I filled in the image, Host URL and clicked Security. As this is an Open API and there is no security requirement, I just left this as is and went to the definition tab: I filled in the various pieces of information here: Then Clicked on new to create a new action for the first of the 2 available API's which is just to receive the VAT number without a reference number and then clicked on Import from Sample: Checking the HMRC documents, this is a GET, so mark as GET and then I put in the URL, the URL is a combination of the Host URL and this end point  /organisations/vat/check-vat-number...

CdsProvisioningNotSupportedInLocation error issues for Dataverse Integration

 You may have seen this error when trying to deploy an environment  for D365 F&O with Dataverse integration  enabled. HttpError: [Bad Request], ErrorCode: [CdsProvisioningNotSupportedInLocation], ErrorMessage: [Currently, Dynamics 365 apps can only be enabled for your default region.], CDS correlation request id: [####]. In my case to fix it I deleted the environment and redeployed a new environment making sure the Azure AD region and region against the Azure Connector in the LCS project settings matched and this fixed the issue.

Exchange Rate Loader PowerApp for D365 F&O - Part 4

Image
 In this final part I am going to go through one of the tweaks I made to the error messaging, what I experienced on running loads was the follow error due to timeouts on the Respond to PowerApps step in my flow: ActionResponseTimedOut . The execution of template action 'Respond_to_a_PowerApp_or_flow' is failed: the client application timed out waiting for a response from service. This means that workflow took longer to respond than the alloted timeout value. The connection maintained between the client application and service will be closed and client application will get an HTTP status code 504 Gateway Timeout. This meant that basically on long running flows the flow succeeded but the messaging back timed out and the user was unaware if it succeeded or not (limit I believe is 2 minutes). The way I resolved to fix this was rather than rely on the Respond to PowerApps step to provide my status, every time I got a response back on the do-until I would write to a Dataverse table ...

Exchange Rate Loader PowerApp for D365 F&O - Part 3

Image
Is this blog I will cover off the following bits from previous post:   1. Put some logic in to allow concurrent loads as currently only supports single person executing at the same time. 2. Allow for dynamic naming of files. 3. Provide a downloadable excel template for users so they can see the required format. To achieve the concurrent loads for multiple users I have placed all the data into blob storage into a separate subfolder which has a unique GUID, this will run when the button for upload is pushed. Then I made adjustments to the ask in power apps stage to pass over the variable: I also adjusted the later stages where we had a step containing the file path like below: Then on the response to function app to zip the packages I have updated the format as below: This means now that when I run the loads individual subfolders are created to hold the packages and Zip file and you can have simultaneous loads happening at once. To accommodate the dynamic naming of files I made the a...

Exchange Rate Loader PowerApp for D365 F&O - Part 2

Image
 In the second part of this blog I will detail some adjustments I made to the app, this include the additional logic for: 1. Add some messaging back to user to let them know if there is any errors. 2. Put some kind of wait bar to give users idea of progress. Firstly to manage the messaging back to the user for both status and error I added two text fields and labels into the APP: Error field and Label has been added and I have modified the "Visable" parameter to only show if "failed" or "PartiallySucceeded" which is some of the data I pass back to the app from the flow: Status field and Label has been added and I have modified the "Visable" parameter to only show for all status's. This is because when the app starts there is no status defined: I also modified the upload control as well visible parameter as I want this to only show when app is not actively loading: I also added a spinner which is detailed here,  PowerApps Tips and Tricks - Cre...