WinMessage and MessageBox Functions

The WinMessage and MessageBox functions sometimes behave as think-time functions, depending on the value passed in the function’s style parameter, which controls, among other things, the number of buttons displayed in the message dialog box.

Note:

The style parameter is ignored if the message has any severity other than Message.

Here is the syntax of both functions:

MessageBox(style, title, message_set, message_num, default_txt [, paramlist])
WinMessage(message [, style] [, title])

Note:

The WinMessage function is supported for compatibility with previous releases of PeopleTools. New applications should use MessageBox instead.

If the style parameter specifies more than one button, the function behaves as a think-time function and is subject to the same restrictions as other think-time functions (that is, it should never be used from SavePreChange through SavePostChange PeopleCode, or in RowSelect).

If the style parameter specifies a single button (that is, the OK button), then the function can be called in any PeopleCode event.

Note:

In the Microsoft Windows client, MessageBox dialog boxes include an Explain button to display more detailed information stored in the message catalog. The presence of the Explain button has no bearing on whether a message box behaves as a think-time function.

The style parameter is optional in WinMessage. If style is omitted, WinMessage displays OK and Cancel buttons, which causes the function to behave as a think-time function. To avoid this situation, always pass an appropriate value in the WinMessage style parameter.

The following table shows the values that can be passed in the style parameter. To calculate the value to pass, make one selection from each category in the table, then add the selections.

Category Value Constant Meaning

Buttons

0

%MsgStyle_OK

The message box contains one button: OK.

Buttons

1

%MsgStyle_OKCancel

The message box contains two buttons: OK and Cancel.

Buttons

2

%MsgStyle_AbortRetryIgnore

The message box contains three buttons: Abort, Retry, and Ignore.

Buttons

3

%MsgStyle_YesNoCancel

The message box contains three buttons: Yes, No, and Cancel.

Buttons

4

%MsgStyle_YesNo

The message box contains two buttons: Yes and No.

Buttons

5

%MsgStyle_RetryCancel

The message box contains two buttons: Retry and Cancel.

Note:

The following values for style can only be used in the Microsoft Windows client. They have no affect in PeopleSoft Pure Internet Architecture.

Category Value Constant Meaning

Default Button

0

%MsgDefault_First

The first button is the default.

Default Button

256

%MsgDefault_Second

The second button is the default.

Default Button

512

%MsgDefault_Third

The third button is the default.

Icon

0

%MsgIcon_None

None

Icon

16

%MsgIcon_Error

A stop-sign icon appears in the message box.

Icon

32

%MsgIcon_Query

A question-mark icon appears in the message box.

Icon

48

%MsgIcon_Warning

An exclamation-point icon appears in the message box.

Icon

64

%MsgIcon_Info

An icon consisting of a lowercase letter i in a circle appears in the message box.