Update method parameters using pre event handler
Some time we need to update methods parameters value. In this blog i will show you that how can we achieve this using "Pre Event Handler" in Microsoft Dynamics 365 Finance and Operations.Example:
Suppose we have multiple designs for "FreeTextInvoice" Report and we always want to pick the Design from "PrintManagement".
For achieve this requirement i am using out of the box form and create the "pre-event handler" of it's method to updates its parameters value
Form Name : CustFreeInvoice
Method Name : printInvoice

Please follow the following steps
- Right click on CustFreeInovice inside the Forms node and click on "Open designer"

- Search "printInvoice" in the Searchbar of the form

- Right click on the "printInvoice" method then click on "Copy event handler method" then click on "Pre-event handler"

- Create new class as "CustFreeInvoiceHandler" and Paste event handler in this class it looks like as shown below

- Now add the following code to update the value of the parameter


No comments:
Post a Comment