Home » Code Snippets » Dnamics AX Mesage Box

Dnamics AX Mesage Box


May 2014
« Apr   Jun »

Q )  How to ask a confirmation from the user ? by showing him proper dialog box ?

A)  You can use the Box class available in Dynamics for it.  ” Box:: “

we have Different Types and scenarios for this ,

TYPE 1 : Notify user

  1. box::info(str _text[, str _title, str _bottomText])
  2. box::warning(str _text[, str _title, str _bottomText])
  3. box::stop(str _text[, str _title, str _bottomText])
Example :
box::info( “You are on dynamics ax associate” , “Microsoft Dynamics Ax”); 

Type 2: Detail Information Notification

There are two methods that produce such dialog box. The second one is an extended version of the first where the ability to define caption is available.
  1. box::infoOnce(str heading, str information, URL helpURL, str owner)
  2. box::infoOnceEx(str _heading, str _information, URL _helpURL, str owner, str caption, boolean _detach)

Type 3: Request for Decision

There is one such dialog box that offers the option not to show the dialog box again. It is a dialog box with Yes and No button plus a Do not ask again checkbox. This is achieved with the method box::yesNoOnce.
The following are the list of methods which also denotes their button combination. This is followed by a figure showing a sample of such dialog boxes.
  1. box::yesAllNoAllCancel(str _text, DialogButton _defaultButton [, str _title])
  2. box::yesNoAllNoCancel(str _text, DialogButton _defaultButton [, str _title])
  3. box::yesNoAxaptaForm(str _text, DialogButton _defaultButton [, str _title])
  4. box::yesNoCancel(str _text, DialogButton _defaultButton [, str _title])
  5. box::yesNoOnce(str _title, str _text, DialogButton _defaultButton, str _owner)
  6. box::yesYesAllNoCancel(str _text, DialogButton _defaultButton [, str _title])
to get the dialogue result use the following code :
if(Box::yesNo(“Press yes to Continue “) == DialogButton::Yes)
   //Yes Pressed

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: