Consume business events
Different endpoint types can consume activated business events by subscribing to finance and operations apps events.
A business event is consumable when it‘s activated, and subscriptions depend on the type of endpoints that are available. Endpoint types for finance and operations apps include:
- Microsoft Azure Service Bus queue
- Microsoft Azure Service Bus topic
- Microsoft Azure Event Grid
- Microsoft Azure Event Hubs
- Microsoft Azure Blob Storage
- HTTPS
- Microsoft Power Automate
- Microsoft Dataverse
When you’re creating a business event from Power Automate, the business event in finance and operations apps is active and an endpoint is created.
In Dataverse, an endpoint is created when a plug-in or an SDK step is registered on a finance and operations apps business event or data event. Then, the endpoint is registered and becomes available on the Endpoints tab.
Business events are part of Microsoft Power Platform integration. Therefore, you need to ensure that your environment is deployed with Power Platform Integration, meaning that it can run only on an Azure-hosted environment but not on a local development virtual machine.
Business events and Power Automate
You can set up business events in Power Automate with the When a Business Event occurs trigger. When the active finance and operations apps’ business event runs, it triggers the endpoint and performs the flow in Power Automate.
To set up Power Automate with a new flow, you need to add a trigger for business events by completing the following actions:
- Sign in to Power Automate portal.
- Select the environment that’s connected to your finance and operations apps.
- Select Create and Start from blank with an Automated cloud flow, and then enter a flow name.
- Find the When a Business Event occurs trigger. We recommend that you search for Dynamics to narrow the search because many triggers exist.
- Enter the instance. You might be prompted to sign in to the tool.
- Enter information in the Category and Business event fields. The business event list that appears depends on the category that you choose.
- Enter the applicable company in the Legal entity field.
To add a new action step to a flow, follow these steps:
- Search for the Parse JSON data operation to parse the message with the data schema.
- Select the Content field to show dynamic content. Select the Body field.
- Go to finance and operations apps, Business event catalog, find the business events, and then select Download schema. The Business event schema downloads as a text file.
- Open the text file and then copy its content to the clipboard.
- Return to your flow, select Generate from sample, and then paste the text. A new JSON is generated.
- Find the type integers and rename it to type number in Power Automate because the type isn’t set correctly.
- Choose another action to consume by selecting + New step, Get a record (Fin & Ops).
- Select the Instance from the dropdown menu.
- From the Entity name dropdown menu, select the CustomersV3 entity.
- In the Object Id field, use the LegalEntity and InvoiceAccount dynamic content to find the customer. The syntax for the Object ID field is DataAreaId,CustomerAccount (a comma should be between the fields without spaces).
- The ObjectId value should be set to company and the field(s) defined as a key on the entity in finance and operations apps. Now the flow can use all fields in the CustomersV3 entity.
- Add a final action by selecting + New step, and then locate the Find Send an email (V2) action.
- Choose an email account to which you want to send the message, and then enter a subject. You can use both fields from CustomersV3 and JSON as dynamic fields.
- Enter a message in the email’s body that you want the recipient to read. You can use both fields from CustomersV3 and JSON as dynamic fields.
- Select Save to save the flow.
After you save the flow, you can locate it in the finance and operations app in the Active business events tab. Also, notice that an endpoint is created that points to Power Automate.
Additionally, the flow sends an email based on the information that you provided, as shown in the following image.
Other endpoints
Microsoft Learn documentation provides many tutorials for using business events for different endpoint types, including:
- Business events and Microsoft Power Automate
- Business events and Azure Event Grid
- Business events and Azure Service Bus
- Business events and Azure Service Bus Queue
- Business events and workflow approvals
- Business events and Microsoft Forms Pro
- Business events and Azure Event Hubs
- Subscribe to events in Dataverse
- Business events in financial period close