Showing posts with label Access Form Controls in D365FO. Show all posts
Showing posts with label Access Form Controls in D365FO. Show all posts

Wednesday, 8 September 2021

Access Form Controls In Form pre/post Event Handlers in Dynamics 365 for Operations (AX7)

This blog will explain all possible ways where form control can be accessed in form using event handlers at different form levels. Events on a form are available at the form level, form control level and on the datasources level in Dynamics 365 for Operations (AX7).

We will access the form control in following

  1. Form’s Method pre/post Event Handlers
  2. Form’s  Event Handlers
  3. Form’s DataSource Event Handlers
  4. Form’s Control Event Handlers
  5. Class’s Method Event Handlers

Form Control Access in Form’s Method pre/post Event Handlers

For example, we are using the CustTable form. and using the init method pre-event handler. we are going to access the CustTable_name control in the event handler. Both pre post event contail XppPrePostArgs class parameter. This will provides information about arguments and return values for event handlers. 




In Form’s Event Event Handlers





In Form’s DataSource Event Handlers





Form’s Control Event Handlers





In Class’s Method Event Handlers







Run AX report using X++

       Args                     args;      ReportRun          report;     salesLineProductPartProd salesLineProductPartProdLocal;     ;     ...