Difference Between MsgGet, MessageBox, & MsgGetText PeopleCode Functions

Your rating: None Average: 3.8 (17 votes)

Wondering why there are 3 different functions or ways to get text
from a message catalog? Check the comparison below and decide which one
best fits your needs.

MsgGet(message_set, message_num, default_msg_txt [, paramlist])
The MsgGet function
retrieves a message from the PeopleCode Message Catalog and substitutes
in the values of the parameters into the text message.
Example: &MsgText = MsgGet(30000, 2, "Message not found");

MessageBox
retrieves messages from the Message Catalog but provides the
flexibility to change the severity of a message through the Message
Catalog, without modifying PeopleCode.
MessageBox(style, title, message_set, message_num, default_txt [, paramlist])
Example: MessageBox(0, "", 30000, 1, "Message not found", BUS_EXPENSE_PER.EMPLID, BUS_EXPENSE_PER.EXPENSE_PERIOD_DT);

MsgGetText is very similar to MsgGet except the message set and message number will not appear after the text of the message.

MsgGetText(message_set, message_num, default_msg_txt [, paramlist])
Example: &MsgText = MsgGetText(30000, 2, "Message not found");

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.
Chris's picture
Chris (not verified)
Re: Difference Between MsgGet, MessageBox, & MsgGetText ...

If using the MessageBox command, how do you hide the message set and message number in a MessageBox? I understand how to do that using MsgGetText vs. MsgGet, but how do I hide the message set and message number using the MessageBox command?

Lepa's picture
User offline. Last seen 8 weeks 4 days ago. Offline
Joined: 06/23/2008
Posts: 590
Re: Difference Between MsgGet, MessageBox, & MsgGetText ...

Quote:
but how do I hide the message set and message number using the MessageBox command

I don't think that is possible.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Siddharth's picture
User offline. Last seen 3 years 34 weeks ago. Offline
Joined: 05/13/2011
Posts: 2
Re: Difference Between MsgGet, MessageBox, & MsgGetText ...

How do you hide the message set and message number in a MessageBox??
Here is the solution for hiding message set and message number,

WinMessage(MsgGetText(&MessageSet, &MessageNumber, "Alt Text"),0);

Guest's picture
Guest
Re: Difference Between MsgGet, MessageBox, & MsgGetText ...

MessageBox(0, "", 0, 0, "Current Pay Run ID should be " | &RunID_S | " or " | &RunID_H);

Guest's picture
Guest
Re: Difference Between MsgGet, MessageBox, & MsgGetText ...

WinMessage is a different command that doesn't provide for different buttons in the dialog box. So this is not a way to suppress the message catalog information in the dialog box.

There is no way to suppress the message catalog information in the dialog box.

Guest's picture
Guest
Re: Difference Between MsgGet, MessageBox, & MsgGetText ...

MessageBox(0, "", 0, 0, "Current Pay Run ID should be " | &RunID_S | " or " | &RunID_H) will still display (0,0) in the dialog box.

There is no way to suppress the message catalog information in the dialog box.

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
4 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.