Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Make a info box always on top and modal

Posted on by 2,983

I have a button in a form.

The clicked method:

void clicked()
{
    ;    
    element.TransferLines();
}


TransferLines Method:

void TransferLines()
{

JournalID = MyClass::TransferAndPostLines(); //Some class i run

box::info("Created Journal: " + JournalID);

element.close(); // I need to close the form after the user accepts the box::info

}

We are having some problems with this code:

1. Sometimes, the box:info is behind the form, so the user never gets the message.

2. During the call to TransferAndPostLines the form is correctly locked, but when the box:info is behind the form as described before, the user can click the button and create a duplicate Journal . 

How can I make the box::info modal and always on top so that the form closes as soon as it's accepted and so the user cannot click on the button again?

*This post is locked for comments

  • Verified answer
    Ghetz Profile Picture
    Ghetz 2,983 on at
    RE: Make a info box always on top and modal

    I don't want the user to have an option "not show again". Also I don't want a "Cancel" as it can create confusion.

    Finally I created my own InfoModal method in the box class:

    public client static DialogButton infoModal(
        str _text,
        str _title      = "@SYS11132",
        str _bottomText = '')
    {
        if( SysTaskRecorderEventManager::parmRecording() )
            return SysTaskRecorderGlobal::handleDialogButton(DialogBoxType::InfoBox, _text, _title, _bottomText,  DialogButton::Ok);
    
        //BP Deviation documented
        return new DialogBox(DialogBoxType::InfoBox,
                             _text,
                             _title,
                             _bottomText,
                             DialogButton::Ok).retval();
    }

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans