Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to pop out a MsgBox in the script

I want to do an IF condition and if it's false , i want to pop out a MsgBox with a message and Ok or Cancel ,

and store the result in a variable .

How is it possible , thank you

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

See "help":

MsgBox(str msg [, str caption [, mb_buttons [, mb_icons[, mb_defbutton]]]] )

This function can be used in the script only and opens a message box during the script execution. The parameters msg and caption are used as message and caption texts, respectively. The parameter mb_buttons defines what buttons will be shown in the message box, according to:

0 or 'OK' for a single OK button,
1 or 'OKCANCEL' for two buttons, OK and Cancel,
2 or 'ABORTRETRYIGNORE' for three buttons, Abort, Retry and Ignore,
3 or 'YESNOCANCEL' for three buttons, Yes, No and Cancel,
4 or 'YESNO' for two buttons, Yes and No,
5 or 'RETRYCANCEL' for two buttons, Retry and Cancel.

The parameter mb_icons defines what icon will be shown in the message box, according to:

0 or empty string for no icon,
16 or 'ICONHAND' for an icon with an X, used for critical errors,
32 or 'ICONQUESTION' for an icon with a question mark,
48 or 'ICONEXCLAMATION' for icon with an exclamation mark, used for minor errors, cautions and warnings
64 or 'ICONASTERISK' icon with an i, used for informational messages.

The parameter mb_defbutton defines what button will have focus when the message box is shown, according to:

0 or 'DEFBUTTON1' if the first button should have focus,
256 or 'DEFBUTTON2' if the second button should have focus,
512 or 'DEFBUTTON3' if the third button should have focus,
768 or 'DEFBUTTON4' if the fourth button should have focus.

The function returns an integer that shows what button has been pressed by the user, according to:

1 for OK,
2 for Cancel,

3 for Abort,
4 for Retry,
5 for Ignore,
6 for Yes,
7 for No

The parameter 3, 4 and 5 will internally be added, so if numeric values other than the above mentioned ones are used, you may get an unexpected combination of icons and buttons.

The message box function returns NULL if the dialog cannot be shown.

Example:

Load
MsgBox('Message 2', 'msgbox', 'OKCANCEL', 'ICONASTERISK')
as x, 2 as r
autogenerate 1;


View solution in original post

2 Replies
Anonymous
Not applicable
Author

See "help":

MsgBox(str msg [, str caption [, mb_buttons [, mb_icons[, mb_defbutton]]]] )

This function can be used in the script only and opens a message box during the script execution. The parameters msg and caption are used as message and caption texts, respectively. The parameter mb_buttons defines what buttons will be shown in the message box, according to:

0 or 'OK' for a single OK button,
1 or 'OKCANCEL' for two buttons, OK and Cancel,
2 or 'ABORTRETRYIGNORE' for three buttons, Abort, Retry and Ignore,
3 or 'YESNOCANCEL' for three buttons, Yes, No and Cancel,
4 or 'YESNO' for two buttons, Yes and No,
5 or 'RETRYCANCEL' for two buttons, Retry and Cancel.

The parameter mb_icons defines what icon will be shown in the message box, according to:

0 or empty string for no icon,
16 or 'ICONHAND' for an icon with an X, used for critical errors,
32 or 'ICONQUESTION' for an icon with a question mark,
48 or 'ICONEXCLAMATION' for icon with an exclamation mark, used for minor errors, cautions and warnings
64 or 'ICONASTERISK' icon with an i, used for informational messages.

The parameter mb_defbutton defines what button will have focus when the message box is shown, according to:

0 or 'DEFBUTTON1' if the first button should have focus,
256 or 'DEFBUTTON2' if the second button should have focus,
512 or 'DEFBUTTON3' if the third button should have focus,
768 or 'DEFBUTTON4' if the fourth button should have focus.

The function returns an integer that shows what button has been pressed by the user, according to:

1 for OK,
2 for Cancel,

3 for Abort,
4 for Retry,
5 for Ignore,
6 for Yes,
7 for No

The parameter 3, 4 and 5 will internally be added, so if numeric values other than the above mentioned ones are used, you may get an unexpected combination of icons and buttons.

The message box function returns NULL if the dialog cannot be shown.

Example:

Load
MsgBox('Message 2', 'msgbox', 'OKCANCEL', 'ICONASTERISK')
as x, 2 as r
autogenerate 1;


Not applicable
Author

Thank you for the answer