Skip to main content

Notifications

Microsoft Dynamics AX forum
Suggested answer

OK button in Dialog

Posted on by 11,873

I have a class extended from RunBaseBatch.In the main method ,I have

if (assignment_Level.prompt())

       assignment_Level.run();

when pressing ok, no response happens although the run method has been overwritten. How can I solve this issue ?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: OK button in Dialog

    public Object dialog()

    {

    DialogRunbase dialogRunbase = super();

    ;

    ""Add all your custom dialog fields. "

    return dialogRunbase;

    }

    As shown above, please do it you will get rid of the problem.

    Regards

    Dilliraj

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: OK button in Dialog

    Please review the dialog() method on the class..

    I suspect there is something wrong in this method..

    Please post the dialog() method body, may that will help find out if there is any issue.

    Please update.

  • PA-22040759-0 Profile Picture
    PA-22040759-0 6,194 on at
    RE: OK button in Dialog

    Could you post a list of methods on your class? And if you have changes to the prompt og dialog methods, could you post the contents of these?

  • maram fraij Profile Picture
    maram fraij 11,873 on at
    RE: OK button in Dialog

    Yes, this issue is only faced in this class which is created from scratch. I tried to duplicate and modify one of the other classes extended from RunbaseBatch which was developed  by one  of our team before and it work properly, so what is the reason for such a problem?

  • dolee Profile Picture
    dolee 11,279 on at
    RE: OK button in Dialog

    Hi,

    Is this only happening to assignment_Level?

    What about other classes that extends from RunbaseBatch?

  • maram fraij Profile Picture
    maram fraij 11,873 on at
    RE: OK button in Dialog

    From the debugging in the method promptPrim() at line dialog.wait() when I press ok nothing happens but if cancel is pressed it goes to next code line dialogCanceled = !dialog.closedOk();

  • maram fraij Profile Picture
    maram fraij 11,873 on at
    RE: OK button in Dialog

    RunBase method has not been overridden .

    the problem is when pressing ok no boolean value returns and so the run method is not executed at all.

    should I modify any method to make ok button returns true?

  • PA-22040759-0 Profile Picture
    PA-22040759-0 6,194 on at
    RE: OK button in Dialog

    That sounds odd.

    Have you overridden the dialog method from RunBase, and in that case how does it look?

    Try to put a breakpoint on assignment_Level.run(); and debug the code to see if you actually hit the run method.

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans