D365 Finance & Operations and Dynamics AX Forum

Whether to use events on custom forms

  • 1.  Whether to use events on custom forms

    Posted Jun 03, 2020 10:46 AM
    Hi all,

    Need some suggestion:

    The requirement is, to execute some code on the click of a button on a custom form.
    If we had a standard form, we would have had to write the code in a relevant event.
    Since we have a custom form, the conundrum is whether to add a method to the buttons methods node, or
    to create a helper class and add _OnClicked event and write the code there?

    1. We no longer have server-client tiers.
    2. Which is more manageable methods in custom forms or relevant events.
    3. To access global variables in events methods, parm methods are required.
    4. To access any datasources or datasource records, additional cumbersome code needs to written.
    5. In future, for any additional changes, all the events are to be checked.

    Any suggestions are welcome!

    With best regards,

    Abhinay Tharwal
    Scania CV AB
    Academy - Online Interactive Learning from Experts

If you've found this thread useful, dive deeper into User Group community content by role