Call a logic app from a business event
Business events in D365 is a nice feature that one can latch on to and use in integrations. In this post we will explore how to call a logic app from a business event that has been triggered.
Pre-requisites:
- Azure subscription with credit
- D365FO with privileges to manage business events
- Office 365 subscription or email via Outlook.com
Business event setup, part 1, schema
In D365FO you have several standard out of the box business events called Business events catalog, located at System administration --> Setup --> Business events.
- Locate and highlight the Business event ID, PurchaseOrderConfirmedBusiness. Press the link Download schema to download the schema file (indicated with a green circle in picture below).
- Open the downloaded file in notepad and keep it open to use it later
Logic app
Go to azure portal, make sure you have credit and able to create a new Logic App. I like using the Azure portal App for simple examples like this. We are to create the simplest logic app possible for our example.
- Create a new blank Logic app
- Add a new step
- Now you need to expand the new step and sign in with your office365 account to provide access to your email.
- Save the logic app
Business event setup, part 2, activate business event
Now we need to create an endpoint and activate the business event.
- Open the Business events catalog, located at System administration --> Setup --> Business events.
- Go to the Endpoints pane
- Create new Endpoint
- Choose type Microsoft Power Automate
- Give it a name and paste in your URL from step 8 (your logic app URL address) in previous section, then press OK.
- Now we need to activate the business event, select your business event named PurchaseOrderConfirmedBusinessEvent and press +Activate.
- Press OK to finish this step
You now have a basic logic app and a business event activated. To test your business event and logic app. Go and confirm a purchase order, you can monitor the run history in the logic app and see the resulting email in your email inbox. Under is an example email received from my environment.
Comments
Post a Comment