My First Microsoft Flow with Dynamics 365 for Financials
What is Microsoft Flow?
Microsoft Flow lets you create automated workflows between your favorite apps and services to get notifications, synchronize files, collect data, and more! Learn more about Flow at https://flow.microsoft.com/en-us/
How can we use Flow with Dynamics 365 for Financials or Dynamics NAV?
With Microsoft Flow, your Dynamics ERP can communicate with other Apps like Outlook, Yammer, SharePoint, Common Data Service, OneDrive and many more. Complete list at: https://flow.microsoft.com/en-us/services/
Some example scenarios:
- When a new Item is created in Dynamics ERP, post an update in Yammer.
- When the credit limit of a customer is updated, send an email notification to the customer
- Update the Common data service when relevant records are created or updated in ERP
- Get an email notification when your requests are approved
In this blog, I would like to explain how I created my First simple Flow with Dynamics 365 for Financials.
Scenario: When a Sales Order is shipped and not invoiced in Dynamics 365 for financials, email is triggered to the customer. we’ll make use of Status field which will be updated to Released in this case. Note that when the order is completely invoiced, the record gets deleted.
Setup required in Dynamics 365 for Financials:
In web services page, make sure the Page 42 (Sales Order) is published. Copy the OData URL.
From User Card page, copy the Web Service Access key of an admin user. If this key is not already generated, you can generate one in the same page.
Create a Flow – Connection:
> Login to https://flow.microsoft.com/ (Sign up for an account if not already done)
> Click on My Flows –> Create from blank
> Search for Dynamics 365 for Financials – when a record is modified trigger
> Enter a relevant Connection Name (ex: Dynamics 365 – Order)
> Enter the ODATA Feed URL which is available in Dynamics 365’s Web Services page
> Enter the User Name and Password (Web Service Access Key) from Dynamics 365’s User Card
> Enter the Company which is available in Dynamics 365 for Financials under Settings –> My Settings
Click on Create!
The connection recognizes all the published OData web services from Dynamics 365 for financials. Under Table name, select SalesOrder.
Create a Flow – Condition:
Click on + New Step –> Add a Condition.
Under Condition step, select the Object Name as Status (Status is a field name in Sales Header table which is open when a sales order is created and released when a sales order is shipped). You can use Add dynamic content option to choose fields easily. Choose Relationship as is equal to and Value as Released.
Create a Flow – Action
Next step is to specify what needs to happen when the condition is met or otherwise.
In our case, when the condition is met we want an email to be triggered to the customer or any other specific email address. Under IF YES option, click on Add an Action and select Office 365 Outlook – Send an email.
Enter the email address in To field or you can select the email address field from Add dynamic content if available (In my case, I’ve manually entered the email address as I do not have an email address in my Sales Order page).
Specify a relevant Subject and Body for the email. You can choose to write the content and also add fields from your web services (using Add dynamic content option) where required.
Click on Create Flow –> Done to complete the flow creation.
We can click on My Flows to view all your flows. You can switch them on/off here, Edit it if any modification is required and see the Flow runs history.
Testing:
Now we can create an order in Dynamics 365 for financials and post the shipment (Do not post the invoice). This changes the status of the order to Released. You can check Flow runs to see the runs.
And here is the triggered email:
It’s fun creating flows! There is so much more we can do. Happy automating workflows between apps.
Comments
- Anonymous
February 20, 2017
Great walkthrough! Flow needs a lot more of these, because it is not intuitive, IMHO. Thank you!