How to trigger Dynamics 365 Finance and Operations business events with Power Automate

May 30, 2024

Dynamics 365 Finance and Operations users often need to perform actions and send notifications based on certain events within the system, allowing stakeholders to make timely, informed decisions. This functionality exists in the form of business events. These events provide a mechanism to alert or notify external systems about changes that occur in the D365FO environment. This can be extremely useful for integrating Dynamics 365 Finance and Operations with other systems or triggering workflows based on specific conditions.

This blog will help you familiarize yourself with the concept of business events and learn how to trigger Dynamics 365 business events with Power Automate.

What is a business event in Dynamics 365 Finance and Operations?

Dynamics 365 business events enable external systems to receive notifications from the Finance and Operations app, allowing for responsive business actions. A business event occurs during the execution of a business process, where users perform tasks to complete the process. By leveraging business events, external systems can act on these notifications to enhance business workflows and operations.
To access business events, navigate to System Administration, select Set Up, and then click on Business Events. The business event catalog displays all available business events in your current instance. You can filter this catalog by category, business event ID, and name to easily find specific events.

How to trigger a Dynamics 365 Finance and Operations business event with Power Automate?

Now that we understand the concept of business events, let’s explore how to trigger them. Before we begin, there are prerequisites to consider. Dynamics 365 Finance and Operations business events are consumed through Microsoft Power Automate and Azure messaging services. Therefore, users must have a subscription to either of these platforms to trigger or utilize business events.
Power Automate, formerly known as Microsoft Flow, is a cloud-based service that makes it practical and simple for end users to build workflows that automate time-consuming business tasks and processes across applications and services.

When combined, Power Automate and D365FO’s Business Events can work together to create powerful, automated workflows. In fact, Microsoft Dynamics 365 and Power Automate integration brings a powerful combination of enterprise resource planning (ERP) and automation capabilities to businesses. For instance, you can set up a business event in D365FO to trigger when a specific condition is met, like an invoice being posted. This event can then be picked up by Power Automate, which can perform a series of actions like sending an email notification, updating a SharePoint list, or even triggering actions in other systems. This integration opens up a world of possibilities for automation and process improvement. There are several Dynamics 365 business events and Power Automate use cases that enable businesses to enhance efficiency, accuracy, and agility in their operations.

Ready to get started? Follow these steps:

Step 1: Go to the Power Automate environment dashboard and click the Create Flow button.

Step 2: Create a new Instant Flow named “D365 F&O business event flow” and select the “manually trigger a flow” option.

Step 3: Click on the add step, search for the “Fin&Ops” connector, and select the “When a Business event occurs” trigger.

Step 4: Now set the value of the parameter. We are going to use the “Batch job started” business event, which lies under the “Batch” category, and set the legal entity, which is a company ID, as “DAT.”

Step 5: Now add the Parse JSON action. Power Automate’s JSON Parse action is a powerful tool that you can use to transform the raw JSON output of an HTTP request into values that you can use as dynamic content in your flows. Select the content “body” dynamically from the above action.

Step 6: To pick the schema as shown in the image above, Go to System Administration> Setup > Business event > Business event catalog. Search by business event ID “BatchJobStartedBusinessEvent” and click on download schema.

Step 7: After downloading the schema, copy it, click the “Generate from sample” button, and paste it as shown in Step 5.

Step 8: Add a compose action and map the values as shown in the image below, but it’s optional. Here, we are filtering the output and making it more readable.

Step 9: Now click on the save button.

Step 10: For testing purposes, we have created a batch job named “Power Automate demo.” But before executing it, click on the Business event option above and enable the start parameter to Yes. Otherwise, your event will not trigger.

Step 11: Run your Power Automate flow and execute the batch job.

Step 12: Your flow will run successfully.

Step 13: To verify the output, you can expand the Compose node, check the Job ID value, and match it with your batch job number in the Fin&Ops environment, as shown in the image below.

Power Automate - Flow output value
Fin&Ops batch job form

Summing up

From posting an invoice to inserting a record in the database, Dynamics 365 Finance and Operations allows you to set business triggers to perform these events easily. You can also create custom triggers based on your specific business needs.
To learn more about business events, creating custom triggers, and troubleshooting business event workflows with Power Automate, contact us at marketing@confiz.com.