Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

How to lock Form during lunch a class?

Posted on by 110

I have a simple Form MyCustomForm, in a Form's Button in Clicked method I call a Class (method run), so I want to lock (or block) this form during run execution.

My code is look like this :

void clicked()
{// in Button clicked in **MyCustomForm**
     MyClass myClass;
     super();
     myClass = new MyClass();

     // here I want to freeze my FORM 
     myClass.run();
    // here I want to unlock my Form
}

I need this because when class (MyClass) is running can display Dialog etc, but I don't want to touch/click and other on MyCustomForm caller.

If I use :

element.wait(); // not work well - block all
myClass.run();


Thanks, enjoy.

*This post is locked for comments

  • daniele scr Profile Picture
    daniele scr 110 on at
    RE: How to lock Form during lunch a class?

    Hi Crispin John Augustine, now I'm doing this way, but for me have a general solution blocking all Form it's better. Thanks anyway!

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to lock Form during lunch a class?

    Hi DanielePax,

         Please check this below link, may useful to you.

    https://msdn.microsoft.com/en-us/library/formrun.lock.aspx

    Thanks

    Suresh

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans