Skip to main content



No record found.

Microsoft Dynamics AX forum
Suggested answer

Form Customization

Posted on by Microsoft Employee


I have a requirement of Closing the form after button click in the action pane, if we  click the button it will open the Runbase batch processing dialog and if I click on "OK" or "cancel" button form is closing automatically since I have  added the code element.close() in clciked method.

My target is like form has to close only when we click on "OK" and to remain running if I click on "cancel "  button.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Form Customization

    Hi Nikolaos,

    I will change the code accordingly and check my scenario.


  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: Form Customization

    The normal look&feel in the systems doesn't work like that. I recommend to consider sticking to the normal look&feel. This would mean that the caller form is not closed automatically if the user clicks OK on the batch dialog.

    However it's possible to achieve it.

    You need something like that in the main method of your RunBaseBatch class (usual disclaimer: this is an illustration only, not real code that you should expect to work in your scenario without changes):

    public static void (Args _args)
        Object caller = _args.caller();
        FormRun callerForm;
        MyRunBaseClass myRunBaseClass = MyRunBaseClass::construct();
        if (caller is FormRun)
            callerForm = _args.caller();
        if (myRunBaseClass.prompt())

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans