You are here: Reference > Activity methods > Page-Set-Messages

Page-Set-Messages method

Use the Page-Set-Messages method to add a message to a clipboard page. Like a message associated with a property, a message associated with a page normally prevents the page from being saved into the database.

A later Page-Clear-Messages method applied to the same page removes the messages set by this method. In addition, page messages are cleared when a workstation user submits an HTML form to the Pega 7 Platform server that includes values for properties on that page.

Parameters

This method has three parameters:

Parameter

Description

Page

Enter a named page from the Pages & Classes tab to contain the message. Use the keyword Primary for the primary page.

This field is optional. If you leave it blank, the system uses the step page, or the primary page if no step page is specified.

Category

Enter a localization category that is the second key part of a field value. The default is pyMessageLabel.

Otherwise, leave this field blank.

Message

Identify the message to add to the page. You can enter values in this field in one of the following ways:

  • The name of a Rule-Message instance, without quotes. The list of available options in the SmartPrompt is limited to Error and blank category messages of the class of the specified Page.

    If the message supports parameters, append a tab-delimited string to the message name.

  • The third key part of a field value rule where the class of the specified Page is the first key part and the value specified in the Category field is the second key part.

    Use this approach when the Category field is not blank and the specified field value does not contain property references. Property references can lead to confusion because field values are evaluated each time the page is read, and property values can change over time.

  • A literal text string within double quotes.

    Avoid this option if your application supports localization.

Results

The message becomes associated with the page as a page message.

Checking the method status

This method updates the pxMethodStatus property. See How to test method results using a transition.