This is another episode of my blog series on the Microsoft Dynamics 365 for Finance and Operations connector for Microsoft Flow. In this blog, I will share some information about the Execute action option. What is it and how can you create your own actions for OData?
Data entities can have certain methods which can be used in OData for executing some business logic like approving a BOM or shipping a transfer order. Also Microsoft Flow is able to use these actions in the Flows. When you add the Execute action from the Dynamics 365 for Finance and Operations connector, you have to provide like other actions the environment first. The second field is the list with all available actions.
Based on the action you have chosen, there will be new parameters to be filled. In the example of using the shipping of a transfer order, you have to provide the Company and the Transfer number which is the actual primary key field of the transfer orders. In the example below, I have used a hard-coded value. It would be possible to use e.g. a source file or business event to get the transfer order dynamically which makes in the real life more sense.
You can save the Flow and start testing. When all settings are correct, the flow will successfully run.
In case there are errors, you can find the cause of the error in the Flow execution history. Like other actions from this connector, the default company of the user should be matching the company where you want to run the Flow.
The action name presented in Microsoft Flow is a combination of the Public collection name (Entity) and after the dash the method name. If you want to find the related object in Visual Studio, you can start a metadata search using the next command:
The query will find the data entity and you can open the designer, find the method and view the code. As you can see, the ship() method, has been enriched with a specific attribute. This SysODataActionAttribute is used to recognize the actions in OData and for this reason also in Flow. You can find some more information about this on Microsoft Docs.
That’s all for now. Till next time!