My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).

25 June 2010

X++ Code Snippet: Using a Message Box

by Patrik Luca 0 comments

Tag



This X++ Code Snippet post describes the use of a Message Box to ask the user for a confirmation before an update or process is executed.

X++ Code Snippet: Using a Message Box

A Message Box will be created using the Box class, asking the end user for a confirmation before the process is executed. Create following job to understand the working of the Message Box. This job will do an update of the CustTable each time the end user presses the OK button in the Message Box, else the CustTable isn’t updated.

static void tutorial_box() 
{

    CustTable   custTable;
    ;


    if(Box::yesNo("Modify customer?"

                  , DialogButton::No)

        == DialogButton::No)
        return;


    ttsbegin;

    select forUpdate custTable

    where custTable.AccountNum  == "1101";


    custTable.Memo += "\r\n"
                   + date2str(SystemDateGet(),123,2,1,2,1,4)

+ " "

                   + time2str(timenow(), 1, 1);
    custTable.update();

    ttscommit;
}



Each time you run the Job a Message Box appears:





If the end user chooses Yes, the Memo field of the CustTable will be update, else not.


Comments 0 comments

Patrik Luca, Ieper, BELGIUM
Feel free to use or spread all of the content on my blog. In return, linking back to my blog would be greatly appreciated. All my posts and articles are provided "AS IS" with no warranties.

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Most Read Entries

Subscribe feeds rss Recent Entries

Categories

Recommended Books


Subscribe feeds rss Recent Comments

This Blog is part of the U Comment I Follow movement in blogosphere. Means the comment field of this blog is made DOFOLLOW. Spam wont be tolerated.

Live Traffic Feed

Recent Visitors

Blog Archive

My Blog List

Followers

Guest Links