More about Message rules |
After you save a message rule, click the Preview toolbar button () to see the text of the message using default values for parameters.
An application includes a Rule-Message instance named DateRange that contained three parameters in the text:
The {1} must be later than {2} and at least 30 days before {3}.
The Property-Set-Message method supplies the name and parameter values in a single method parameter Message. This value is interpreted as a Java string. Values for each message parameter follow the name, separated by the literal /t.
To following are possible values for the Message parameter of the Property-Set-Message method:
"DateRange/tstart date/ttoday/the end date"
which becomes:
The start date must be later than today and at least 30 days before the end date.
"DateRange/tstartdate "+ .StartDate+" /tJanuary 1, 2006/ttoday".
which becomes:
The start date 20051201 must be later than January 1, 2006 and at least 30 days before today.
Use the standard function rule getMessageRule(tools, messagekey) to return the text of a message rule identified in the second function argument, with text substitutions for message parameters as described above. Localization of text through field values may occur.
In an activity, use as a best practice the Property-Set-Messages method or the Page-Set-Messages method to add a message to the clipboard. In other contexts when writing Java, call the PublicAPI method addMessage() to add a message. The call takes the form:
theProperty.addMessage("RuleMessageKey/tText1/tText2...");
where RuleMessageKey is a key to a Rule-Message rule, and the optional Text1, Text2 and so on are text values. (This method has no effect if the message identified by RuleMessageKey is already present.)
message, validation | |
Page-Set-Messages
method
Property-Set-Messages method |