Wednesday 7 February 2018

How to get the OOTB Form Object and its methods in Pre / Post Events in AX7 / D365

Recently I came across a scenario on which calling from a specific menu item I need to pre-populate some fields on product creation form . When I did some research I found in EcoResProductCreate form that there are already written parm methods in which all I need to do is to pass my value and let parm method do the rest. But for that I need to get the form object and its methods. To achieve this there are two options :
1- Use chain of command
2- Use Event Handlers

In this blog I have used event handler technique. Please see the below screen shot.

Note: When you assign form object to your initialized object, there will be no intellisense shown. So for that you need to explicitly write your desired method.

No comments:

Post a Comment

How to Get Customer Free Text Invoice "Totals" form field value with X++ in D365FO

Customer free text invoices are an essential aspect of financial management in D365FO. In this blog, I have compiled all the code needed to ...