Message Catalog in PeopleSoft

Message Catalog is the central repository for all Messages, Warnings and Errors used in PeopleSoft. Functional users can edit the text based on business needs without having to involve a developer. And it comes out of the box with multilingual support.

Developers can use functions like MessageBox to retrieve text from the Message Catalog and display it to users.

Message Catalog Navigation

PeopleTools > Utilities > Administration > Message Catalog

Adding Message Catalog Entries

Message Catalogs are organised by Message Set Numbers.

So you could create a new message set for a new project or a new bolt-on you are working on.

In fact, if your team works on large projects in dedicated environments, it would be a good idea to allocate a message set per project so that developers don’t end up overwriting each others’ messages when these projects go live.

Description and Short Descriptions fields are to add text that could help identify what a particular message set is being used for.

Message Number is used to identify a message within the message set.

Each message can be assigned a severity. This is discussed later in the article.

The Message text is used to specify the Error / Warning or Message text.

The Description field below it is used to provide more details of why the message was shown and could include ways to fix the issue.

Delivered Message Catalog Numbers

All message sets up to 20,000 (that is, 1 to 19,999) are reserved by Oracle – this means that Oracle can make changes to these messages in future upgrades. So if you make changes to these, they could potentially be overwritten by Oracle’s changes.

Custom Message sets can start from 20000 and go on till 32,767.
However, Oracle recommends that you use message sets from 20,000 to 30,000 to create new messages.

Message Catalog Severity

How a message appears to the user is determined by the severity.
It also decides how the component processor responds after the user acknowledges the message.

Cancel

This is a rare severity that is used only when a critical error occurs and the process must be aborted

Error

When this severity is encountered, the processing is stopped and data cannot be saved until the error is corrected.

Message

This severity is used for informational messages. Processing continues normally after encountering this.

Warning

When this severity is encountered, the user can decide whether to stop or continue processing.

Message Catalog Tables

Like most things in PeopleSoft, Message Catalogs are saved in Tables – the following are the record names used.

PSMSGSETDEFN

This record contains the definition of Message Set Numbers.
The related language record for this record is PSMSGSETLANG.

PSMSGCATDEFN

This record contains the text for all messages, errors and warnings.
The related language record for this record is PSMSGCATLANG.

Search Message Catalog

If you have the text that belongs to a message and want to quickly find the message set and message number that the text belongs to, the following SQL would be handy.

SELECT * FROM
   PSMSGCATDEFN
   WHERE 
   UPPER(MESSAGE_TEXT) LIKE '%<YOUR SEARCH TEXT>%';
SELECT * FROM
   PSMSGCATDEFN
   WHERE 
   UPPER(DESCRLONG) LIKE '%<YOUR SEARCH TEXT>%';

Using HTML in Message Catalog

You can use HTML within Message Catalogs
HTML can then be retried using functions like MsgGetText or MsgGetExplainText from within PeopleCode. This method can be used to have URLs/hyperlinks as well as do text formatting like making your text bold etc.

HTML in Message Catalog

RX_DERIVED_DEMO.HTMLAREA.Value = MsgGetText(20000, 5, "Message not found");

However, if these messages are displayed using MessageBox function, the HTML tags will be displayed as plain text.

Message Catalog functions

Let’s look at the message catalog functions using the following message catalog entry.

Message Catalog Functions

MsgGet

This function lets you retrieve the message text from a Message Catalog entry. It also supports the substitution of values for the parameters set in the message text. The text that’s returned has the message set and the message number appended to it.

&sMsg = MsgGet(20000, 4, "Message not found", "2022");

&sMsg will now have the following value.

This is 2022. (20000,4)

MsgGetText

This function lets you retrieve the message text from a Message Catalog entry. It also supports the substitution of values for the parameters set in the message text. The text that’s returned does NOT have the message set and the message number appended to it.

&sMsg = MsgGetText(20000, 4, "Message not found", "2022");

&sMsg will now have the following value.

This is 2022.

MsgGetExplainText

This function lets you retrieve the message text from a Message Catalog entry. It also supports the substitution of values for the parameters set in the message text. The text that’s returned does NOT have the message set and the message number appended to it.

&sMsg = MsgGetExplainText(20000, 4, "Message not found", "2022", "2020");

&sMsg will now have the following value.

A couple of years back it was 2020.

Note that the first parameter has been used by the message text and the second one is used for the explain text.

MessageBox

This function displays the message text/explain text directly to the users. Read more about MessageBox.

MessageBox(0, "", 20000, 4, "Message not found.", "2022", "2020");

This will display the following message box.

MessageBox Example

Bind Variables / Parameters

Message Catalog allows the use of %1, %2 etc. which serve as placeholders within the message text as well as the description fields. The values used to populate these are passed on dynamically during execution.

MessageBox(0, "", 20000, 4, "Message not found.", "2022", "2020");

How to use Message Catalog in PeopleCode?

Built-in functions like MsgGet, MsgGetText, MsgGetExplainText or MessageBox can be used to access Message Catalogs from within PeopleCode.

Comparing Message Catalogs

PeopleTools 8.58 introduced the functionality to compare message catalogs.
If you are on a Tools version prior to this, SQL statements could be used to query PSMSGSETDEFN and PSMSGCATDEFN between databases to compare message catalogs.

Migrating Message Catalog Entries

Message catalog entries can be added to App Designer projects and directly migrated from one environment to another.

However, prior to PeopleTools 8.58, Message Catalogs couldn’t be copied to files.
So if you had to move message catalogs between environments that were on different Tools versions, it was common to use data mover scripts.

If you are using Data Mover Scripts, you just have to move the corresponding entries in these tables – PSMSGSETDEFN and PSMSGCATDEFN.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*