Text property: PSMessage class
Description
This property returns the text of the message (as a string) for the error message associated with the PSMessage object. It also includes a contextual string that contains the name of the field that generated the error. The contextual string has the following syntax:
{ComponentInterfaceName.[CollectionName(Row).[CollectionName(Row).[CollectionName⇒
(Row)]]].PropertyName}
The contextual string (by itself) is available using the Source property of the PSMessage.
You can use the Text property in conjunction with the MessageNumber property (which contains the error message number), the MessageSetNumber property (which contains the error message set number), and the ExplainText property (which contains text explaining the error.)
This property is read-only.
Example
Local ApiObject &MYSESSION, &COL, &ERROR;
Local string &TEXT;
.
.
.
If &MYSESSION.ErrorPending Then
/* received error */
&COLL = &MYSESSION.PSMessages;
For &I = 1 to &COLL.Count
&ERROR = &COLL.Item(&I);
&TEXT = &ERROR.Text;
/* do error processing */
End-For;
End-if;
Related Topics