Finally, I have got around to Business events.
In this blog post, we will go through this feature in details. Additional details about this feature, you can read here: https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/business-events/home-page
I find this feature fascinating because it’s one of the no-code/low code abilities. It enables you implementing the process of notifications upon any event.
What are Business events and Why are they so cool?
According to the Microsoft’s definition, business events are:
In Finance and Operations, a business action that a user performs (can be either a workflow action or a non-workflow action) can generate business events that external systems can use in integration and notification scenarios.
Despite the fact that Business event catalog is quite meager yet, you still can make the most out of this functionality. In this example, we will take one of the existing business events and will try to build notification based on the action that user performs.
You as finance representative, would like to manage finances in an easily way as well as prioritize the clients who are buying more. It all comes down to quick and seamless process of sending the notification when free text invoice is posted in the Microsoft Dynamics 365 for Finance and Operations.
Navigate to the Business events form: System administration > Setup > Business events > Business events.
Highlight Free text invoice posted event
Click Download schema button.
Txt file, called BusinessEventSchema_CustFreeTextInvoicePostedBusinessEvent, will be downloaded with the following information inside.
Next, you can use https://www.jsonschema.net/ a web application, to generate JSON schema from JSON. To do so, copy data from the BusinessEventSchema_CustFreeTextInvoicePostedBusinessEvent file and paste to the JSONSchema.Net web app into left side section.
- Click Infer schema button to generate JSON schema.
- Click Remove lines button.
- Copy to clipboard generated JSON schema.
Navigate to https://us.flow.microsoft.com/en-us/ to create MS Flow for the notifications.
Log in and switch to My flows.
Click New button.
Choose Instant-from blank option.
Search for a trigger – “When a HTTP request is received”.
Paste copied JSON schema into Request Body JSON schema section.
Select method POST.
Click Save and copy HTTP POST URL. This will be needed later.
Add new action and choose Send an email.
In this case, we would like to send notification via email when free text invoice has been posted.
Save the created MS Flow.
In the To field, select recipient email.
In the Subject field, type in the text and select the valid fields for the subject of the email.
In the Body field, type in the text and select the valid fields for the body of the email.
Go back into Microsoft Dynamics 365 for Finance and Operations, into Business events form.
Create New endpoint by clicking New button.
Select Microsoft Flow Endpoint type and click Next.
Type in the Endpoint name.
In the Flow URL section, paste HTTP POST URL value copied from MS Flow.
Click OK button.
New Endpoint has been created.
Switch to the Business event catalog tab, highlight the Free text invoice posted event and click Activate.
Select the company where the event will be activated.
Select the endpoint for the event.
Once business event is activated, you could give it a try and post free text invoice.
Once Free text invoice has been posted and message appears….
Go to System administration module > Periodic tasks > Start business events batch job.
Select Batch processing flag and click OK.
Wait until MS Flow executed successfully.
Email will be sent out as presented below.
Business events are viable functionality that is simple to configure. Beyond that, Business event feature is definitely nice-to-have feature. Even though the list of business events are not completed yet, there are already some useful business events.