Posts

How to Cancel Dynamics 365 Dataverse Order in 2024: Step-by-Step Guide

Image
There was a request to cancel orders through the Dynamics 365 CRM API. Microsoft does not provide exact documentation on how to do this. It does show which action to call, but not what to send in the body of the request. To be able to do this, you have to call the following action endpoint: {dataverse-url}/CancelSalesOrder {     "OrderClose" : {         "@odata.type" : "#Microsoft.Dynamics.CRM.orderclose" ,         "salesorderid@odata.bind" : "/salesorders({salesorderguid})" },     "Status" : -1 } If you call this endpoint with this body and you place the salesorderguid of the order you want to cancel, the resulting order will be cancelled.

Cancel Ongoing Flow Runs in Microsoft Dynamics 365 Dataverse: Complete Guide

Image
We came across an issue that a lot of flow runs that were accidentally triggered based upon a mutation of a Dataverse/CRM entity action in a specific flow. Microsoft does have a solution to cancel runs using the power automate template ( Power automation cancel bulk template ) However, the issue is that this cancel around 5000 flow runs in 18 hours since there is a delay of around 10 seconds. If you remove the delay, the flow does not give the expected results. Authorization Now the question is how to fix this issue? There is a flow api that allows you to cancel flow runs, but there are some steps to take to be able to do this. Create an app registration in microsoft azure ad/entra with the permission 'Flows.Manage.All' and add the redirect url 'https://global.consent.azure-apim.net/redirect' under Authentication Add a secret to the app registration write this down because you won't be able to see it anymore after creation. In postman create a collection with the au...