In this part of the Flow blog series, I will discuss the Delete action for the Microsoft Dynamics 365 for Finance and Operations connector. I posted a blog before on this action. See: How Microsoft Flow can help on data corrections in Dynamics 365 for Finance and Operations.
Delete record action
You can use the delete record action for removing records from a Dynamics 365 for Finance and Operations environment. Compared to inserts and updates, deleting records is used less often, but for sure required in a system. For this blog, I created a small demo based on removing system users. Ideally, the users will be deactivated automatically when they are removed or disabled from Azure Active Directory, but that is something that is not working out of the box.
New compared to my earlier posts, is that the button trigger now has an input to request for a user ID. The variable name can be chosen by yourself; also the instruction text. Then the delete action can be used and input can be used as variable within the Flow. The delete record action is requiring an Object id. This is similar to updating records. The key fields should be provided; eventually prefixed with the company ID. In this case, the system user table is a global table and the company ID is not used.
You can test the Flow an provide a User ID.
If the user is found and can be deleted, the Flow will end successful.
In case of an error, you can drill down into the details to find out what could be wrong.
Mobile Flow button
On your mobile device, you can also start the Flow and provide the User ID to be deleted.
Then you can look at the progress to see if things went fine.
There is more…
Like the Update a record action, for now, you can only delete global records and records related to your default startup company. If this is not the case, the Flow will fail.
When you are using an insert or update action, the list with key fields to be able to define the Object id is listed like mentioned in my previous blog posts. Using the Delete record action, this is not visible. You can actually temporary insert an Update a record action to see which key fields needs to be used.
In my next blog, I will explain the Get a record action together with a small example.
That’s all for now. Till next time!