Session Class Properties

This section describes the Session class properties. The properties are discussed in alphabetical order.

Description

This property indicates whether there are any error messages pending for the API that is currently running. After this property has been set, it returns True until the PSMessages collection is cleared (or deleted.)

This property is read-only.

Example

If &MYSESSION.ErrorPending Then
   &COUNT = &MYSESSION.PSMessages.Count;
   For &I = 1 To &COUNT
      &ERROR = &MYSESSION.PSMessages.Item(&I);
      &TEXT = &ERROR.Text;
      WinMessage("Error text " | &TEXT);
   End-For;

&MYSESSION.PSMessages.DeleteAll();

Description

This property returns a reference to a PSMessages collection object. If there are no messages, this property returns an object reference to PSMessages with a count of zero.

This property is read-only.

Example

If &SESSION.PSMessages.Count > NULL Then
   /* there are messages do processing */
End-if;

Description

This property is used to determine how messages are output. This property takes either a numeric value or a constant. The default value is 1 (%PSMessages_CollectionOnly).

You must set this property before you check the type of message, that is, you can't check the type of message, then decide how it's displayed.

This property sets the value for the session. You can change modes during a session, such as, if you're starting a Component Interface. However, after you run the Component Interface, you should set the value back. For example:

&OldMode = &Session.PSMessageMode;
&Session.PSMessagesMode = 1;
...
&Session.PSMessagesMode = &OldMode;

You can specify either a numeric value or a constant. The values are:

Numeric Value

Constant Value

Description

0

%PSMessages_None

None.

1

%PSMessages_CollectionOnly

PSMessage Collection only (default).

2

%PSMessages_MessageBoxOnly

Message box only.

3

%PSMessages_Both

Both collection and message box.

Note: If you set this property to 0 (%PSMessages_None), all messages are ignored. Use this option with caution.

This property is read-write.

Example

Local ApiObject &SESSION;

&SESSION = %Session;
&MMODE = &SESSION.PSMessagesMode;
&SESSION.PSMessagesMode = %PSMessages_MessageBoxOnly;

Description

This property returns a reference to a RegionalSettings collection object.

This property is read-only.

Description

This property returns a reference to a Repository object.

Description

This property turns off the PeopleSoft automatic formatting when coercing a string into a field. Formatting is typically necessary for external Component Interface users (such as for a Visual Basic program,) yet should be suspended for a PeopleCode program. You should not typically need to set this value yourself, as it’s set appropriately based on where the session object is created.

This property takes a Boolean value: True means formatting is suspended, False means it isn’t suspended. If you start your session from a PeopleCode program, the default for this property is True. If you don’t start the session from a PeopleCode program, the default is False.

This property is read-write.

Description

This property returns a reference to a TraceSettings collection object.

This property is read-only.

Description

This property indicates whether there are any warning messages pending for the API that is currently running.

This property is read-only.