Wednesday 1 May 2024

Custom Business events Part 3 - (Activate custom business event) in D365 F&O

 In this blog we will discuss about the steps to activate a custom business in D365 F&O.

As we know that business event catalog does not get automatically refreshed. So, we need to do that step manually.

1) Go the System administration > Setup > Business evens > Business events catalog.


2) Click on Manage > Rebuild business event catalog



3) Once the process is completed then you will be able to see info message on the screen.


4) You may search the custom business event in the business event catalog  tab.


5) Select the relevant custom business event and click on Activate button.

6) A new form with name configure new business event will appear. Select the  relevant legal entity and endpoint name which was created earlier and click Ok button.



7) Once it is activated. The custom business event will appear in the Active events tab.






Custom Business events Part 2 - (Create custom business event via code) in D365 F&O

 In this blog we will discuss about the steps to create custom business event via code in D365 F&O.

As we have already discussed in our previous blog that we need a custom business event which will be used to send notification to third party. This trigger will be consumed by logic app to send the information or notification to the third party.

In order to create a custom business event we need to create following three class artifacts:

  • BusinessEventsContract class
  • BusinessEventBase class
  • A Trigger class to send the business event
Below are the code snippet to create above mentioned classes : 

1) Create BusinessEventsContract class

Business event contract class is used to define internal state, implement initialization method, static constructor and implement parm method to access the contract state.


2) Create BusinessEventBase class.

In order to create custom base we need to extend it from the business event base class. After extending we need to implement a private new method, methods to maintain internal state, static constructor method,  and buildContract method.



3) A Trigger class to send the business event

This class will be responsible to trigger the business event.





Custom Business events Part 1 - (Setup end point) in D365 F&O

In this blog we will discuss about the setup of end point  in D365 F&O.

Before jumping into the process of set up. I want to add on some information regarding business events.

What are business events?

The business event in D365 F&O is way through which external system receives messages from D365 Finance and Operations.

Let's take a example :

We have a external system who want to know when the process of creating lines within trade agreements is completed. Then D365 F&O should send some notification or information  to the external system.

 In order to meet with business requirement we will need business event which will be triggered once the process is completed in D365 F&O. For this purpose we are planning to create a custom business event which will be triggered after completing certain operations. This trigger is sort of notification for the third party that the process has been completed. 

Later on the triggered will be consumed by logic app in order to send notification or information to third party.

Before jumping to code for creating custom business event.

We need to setup a end point in D365 F&O.

Below are the steps to setup the end point in D365 F&O.

1) Go the System administration > Setup > Business evens > Business events catalog.

2) Click on the end points tab and +New button.


3) A new dialog box will open with the name of configure end point. Select Azure Service Bus Topic from the drop down of the endpoint type field and click Next button in the bottom.





4) Another form with new fields will be displayed where we need to fill in the following mandatory fields.
Once all field are completed then click ok button.
  • Endpoint : Define a name for the end point.
  • Azure active directory application id : You need to go to the portal.azure.com. Go to azure active directory > the App registration > Select app which is using D365 instance. Open the app and select the value appearing next to Application client id. Paste the same value in the Azure active directory application id.
  • Azure application secret : We need here the client secret id of the azure app registration record which was created earlier.
  • Key Vault DNS Name : We need a azure key vault name in the DNS name.
  • Key Vault Secret name : We need here the secrete  of the  azure key vault which is used in the field of the key vault dns name. This information will be fetched from the azure portal in the resource section against available key vault.

Topic name field is option but it is good to give some value.




5) Once the process is completed then the business event end point will appear in the end point tab.



Custom Business events Part 3 - (Activate custom business event) in D365 F&O

 In this blog we will discuss about the steps to activate a custom business in D365 F&O. As we know that business event catalog does not...