Customization Of System Table Methods In Dynamics 365 FinOps Using Event Handler

COMMENTS ()
Tweet

In Dynamics Ax 2012, customization on table methods is done by simply overriding them, but in Dynamics 365, we use data event handlers to customize business logic on table methods, and control the behaviour of methods by using two types of events:
1) Proceeding Event ( that occurs before the method’s super() is called)
2) Succeeding Event (that occurs after the method’s super() is called)

For example, the insert method has two events:
1) OnInserting(Preceding Event that occurs before the record is inserted into CustTable)
2) OnInserted(Succeeding Event that occurs after the record is inserted into CustTable)

To use data event handlers, use the following steps:

1) Create a class named “CustTableEventHandler.”
2) Open CustTable, and expand the events node as shown in the below screenshot:

3) In the events node, right-click on the event named “OnInserting”, and select “Copy Event handler Method.”

 

4) Now paste it into your class named  “CustTableEventHandler”, as shown in the below screenshot:

5) Now, let’s say we have a scenario in which we must default some value in the table’s field before insertion takes place. We will modify the code as shown in the below screenshot:

6) Now build the code and run. You will see whenever some record is inserted into CustTable, its field named “ShippingCompany” is defaulted to the value “USPS”.

Muhammad Uzair Kamdar is a skilled software engineer specializing in Dynamics 365 FinOps within the Dynamics division. With a wealth of experience, he excels in customizing Dynamics 365 FinOps to meet the unique needs of organizations. Throughout his career, Uzair has successfully undertaken multiple integration projects, seamlessly connecting Dynamics 365 with other systems to streamline business operations and enhance efficiency. His expertise in integration methodologies and technologies has enabled him to design and implement robust solutions that optimize data flow and improve overall business processes. With a strong foundation in software engineering, Uzair has demonstrated a deep understanding of Dynamics 365 FinOps and its various modules. His comprehensive knowledge allows him to create tailored solutions that address complex financial and operational challenges faced by organizations.

CALL

USA408 365 4638

VISIT

1301 Shoreway Road, Suite 160,

Belmont, CA 94002

Contact us

Whether you are a large enterprise looking to augment your teams with experts resources or an SME looking to scale your business or a startup looking to build something.
We are your digital growth partner.

Tel: +1 408 365 4638
Support: +1 (408) 512 1812