Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Form Customization

Posted on by Microsoft Employee

Hi,

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.

    Thanks!

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 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())
        {
            callerForm.close();
            myRunBaseClass.run();
        }
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans