Wednesday 1 May 2024

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.





No comments:

Post a Comment

Note: only a member of this blog may post a comment.

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...