System Variables Reference

In this section, each system variable is discussed in alphabetical order.

Description

Indicates whether the Allow Notification check box for the current role's workflow routing options is selected. This system variable returns a Boolean value: True if the check box is selected (notifications allowed), False otherwise.

Related Links

Security Basics

Description

Indicates whether the Allow Recipient Lookup check box for the current role's workflow routing options is selected. This system variable returns a Boolean value: True if the check box is selected (recipient lookup allowed), False otherwise.

Related Links

Security Basics

Description

Returns the current setting of the application log fence (AppLogFence) setting in the application server configuration file (PSAPPSRV.CFG.)

Note: This is distinct from the PeopleTools LogFence capability which applies to PeopleTools level logging.

You can use this system variable to conditionally determine whether you want to do certain logging from your application. You generally use it with the following predefined PeopleCode constants.

Numeric Value

Constant Value

Description

1

%ApplicationLogFence_Error

Allow all levels of errors to be written to the log. This is the lowest setting.

2

%ApplicationLogFence_Warning

Allowing only warnings or higher to be written to the log.

3

%ApplicationLogFence_Level1

Allow only this level of errors or higher to be written to the log.

4

%ApplicationLogFence_Level2

Allow only this level of errors or higher to be written to the log.

5

%ApplicationLogFence_Level3

Allow only this level of errors to be written to the log.

Example

If %ApplicationLogFence > %ApplicationLogFence_Warning then
      /* do some logging */
End-if;

Description

Returns the as-of-date of the environment that the PeopleCode is running in. In most cases, this is the current date, but for Application Engine environments, it is the processing date of the Application Engine program.

Description

This system variable returns a single sign on authentication token for the user after SwitchUser is executed. For example, you can use this system variable to write a single sign on cookie to the http response after a new user is authenticated.

Note: This system variable returns a valid value only after SwitchUser executes successfully. The value of this system variable is the authentication token itself. The value of the AuthTokenDomain Request object property is the domain across which the authentication token is valid, set in the AuthTokenDomain configuration property in the configuration properties file.

Related Links

SwitchUser, AuthTokenDomain

Description

%BPName is relevant when the user has accessed a page from a worklist entry. It returns a string containing the name of the Business Process for the worklist entry. It returns an empty string if the user didn’t access the current page group from a worklist.

Description

%ClientDate returns the current date for the current user, adjusted for the user’s time zone. This is the date as specified with the current user's personalizations.

You can use this system variable as the default constant for a date field, a time field, or a datetime field.

Note: This is potentially one day different than the server date, which is returned with %Date.

Description

%ClientTimeZone returns the current time zone for the current user as a three-character string. This is potentially different than the server time zone. This is the timezone as specified with the current user's personalizations.

Description

%Component returns an uppercase character string containing the name of the current component, as set in the component definition.

Description

%CompIntfcName returns the name of the Component Interface, if the currently executing PeopleCode program is being run from a Component Interface. If the currently executing PeopleCode program is not being run from a Component Interface, this variable returns NULL (if the program is running from PeopleCode) or "Nothing" (if running from Visual Basic.)

Note: This system variable is not valid in an iScript.

Description

%ContentID returns the identification of the content for the current context as a string. The format of the value depends on the type of content.

PeopleSoft Pure Internet Architecture Content Type

Content ID Format

Component

Menu.Component.Market/?Page=Page &Action=Action &Key ID = Key Value

Script

Record.Event.Function/?&Parm ID = Parm Value

External

URL

Homepage

tab name

Template

template name

Query

query name

Worklist

worklist name

Navigation

Business Process Map name

File

file name

Description

%ContentType returns the type of content for the current content as a string.

For example, suppose your PeopleCode is part of the page USERMAIN_SELF, in this URL:

http://serverx/servlets/psp/eprocurement/hrms/c/MAINTAINT_SECURITY.USERMAIN_SEF.GBL

This system variable returns the following:

c

The content types are:

PeopleSoft Pure Internet Architecture Content Type

Value

Component

c

Script

s

External

e

Homepage

h

Template

t

Query

q

Worklist

w

Navigation

n

File

f

Description

This system variable returns a string suitable for use as a standard PeopleSoft copyright notice.

Description

This system variable returns the preferred currency for the current user.

Description

%Date returns a Date value equal to the current server date. This is potentially different than the client date, returned by %ClientDate. You can use this system variable as the default value for a date field.

Description

%DateTime returns the current server date and time as a Datetime value.

Note: This variable does not return actual milliseconds. It always returns zeros for the millisecond value.

Description

%DbName returns the name of the current database as a string value.

Note: On SQL Server, the value returned is the ODBC name for the database.

Description

Note: This system variable has been deprecated and remains for backward compatibility only.

%DbServerName returns an empty string.

Description

%DbType returns a string representing the type of the current database. The valid values are:

  • APPSERVER

  • DB2

  • DB2UNIX

  • MICROSFT

  • ORACLE

Note: Supported database platforms are subject to change.

Description

This system variable returns the email address of the current user.

Description

%EmployeeId returns an uppercase character string containing the Employee ID of the user currently logged on. This is typically used to restrict access to an employee's own records.

Description

This system variable returns external connect information. Programmers can customize the authentication process by passing in binary data. This data is encoded with base64 encoding and passed to sign on PeopleCode as a string using this system variable.

Note: This system variable can be used only in Signon PeopleCode. This system variable isn't applicable with the PeopleSoft Pure Internet Architecture.

Description

This meta-variable returns the current file path as a string.

Note: This is not a system variable. This is a meta-variable only available in a Application Engine program.

Description

This system variable returns the name of the last homepage tab visited by the user as a string.

Description

This system variable returns the JSON document schema as a string.

Description

This system variable returns the XML document schema as a string.

Description

%Import returns True if an import is being performed by PeopleSoft Import Manager and False if not.

Description

Use the %IntBroker system variable to return a reference to a web services gateway object.

Description

This system variable returns True if the current user is multi-language enabled.

Description

%Language returns a string value representing the current session's language as selected from the signon page.

Note: This function remains for backward compatibility only. Use the %Language_User system variable instead.

Related Links

%Language_User, SetLanguage

Description

%Language_Base returns the base language for the current database, as set with the PeopleTools Options page.

Description

If multi-language entry is enabled, %Language_Data returns a string value representing the current data language selected by the user.

If multi-language entry is not enabled, %Language_Data returns the current session language.

Use %Language_Data if your application must know the language any entered application data is stored as in the component's related language records. Do not use this variable to control the user interface, such as messages or page text. For determining the language of the user interface, use the %Language_User variable.

Related Links

%Language_User

Description

%Language_User returns a string value representing the current session's language as selected from the signon page. This value can be changed for the current session with the SetLanguage function.

Note: The value of this system variable may not reflect the current data language if the user has multi-language entry enabled.

Related Links

SetLanguage

Description

%LocalNode returns the name of the local node for the current database as a string.

For example, suppose your PeopleCode is part of the page USERMAIN_SELF, in this URL:

http://serverx/servlets/psp/eprocurement/hrms/c/MAINTAINT_SECURITY.USERMAIN_SEF.GBL

This system variable returns the following:

hrms

Related Links

Understanding Nodes

Description

The %MAP_Market system variable returns a three-character String value representing the default-market. While Mobile Application Platform (MAP) applications are not categorized by market as PeopleSoft components are, certain PeopleCode built-in functions, such as GenerateComponentPortalURL, that may be used in MAP applications require the market as an input parameter. Use this %MAP_Market system variable to supply the default market to these functions.

Description

The %Market system variable returns a three-character String value for the Market property of the current component. This is useful if you want to add market-specific PeopleCode functionality to a component. For example:

if %Component = COMPONENT.PERSONAL_DATA then
   /* do some stuff that applies to all localized version */
   :
   :
   /* do some stuff that differs by market */
   evaluate %Market
      when = "USA"
       /* do usa stuff */
         break;
      when = "GER"
         /* do german stuff */
   end-evaluate;
end-if;

The Market property of a component specifies a component’s target market. This property is set when a component is initially saved or cloned.

Components that are used on a global basis have a market setting of "GBL". Variations of components targeted at a specific market can have a local Market setting, for example "FRA". This enables developers to avoid cloning, renaming, and coding distinct PeopleCode in market-specific components. Instead, they can create a single component with market-specific PeopleCode, then clone the component, applying different Market property settings.

Because the %Market string is a three-character string like Country Code, Country Codes can be used as market settings where appropriate.

Considerations Using %Market in Application Engine Programs

Whenever %Market resolves to no value, it is processing in global ('GBL'). The absence of a value should be treated the same as if the value is 'GBL'.

To process a non-GBL market, a row must be created in PS_AEREQUESTTBL with the desired market value placed in the MARKET field of that row.

Note: You must make this change to the table for every application engine program PeopleCode that refers to %Market.

Description

%MaxMessageSize returns the current size limit of messages as set on the PeopleTools Options page.

Description

%MaxNbrSegments returns an Integer value representing the maximum number of message segments as defined on the PeopleTools Options page. The default value is 10.

Description

%Menu returns an uppercase string containing the current menu name. It can be used to restrict edits or processing to a specific menu.

Note: Do not use the %Menu variable in the SearchSave event. You may get unexpected results.

Description

%Mode returns a String value consisting of an uppercase character specifying the action a user selected when starting the current component. The following values can be returned. You can check either for the string value ("A", "U", and so on.) or for the constant:

Numeric Value

Constant Value

Description

A

%Action_Add

Add

U

%Action_UpdateDisplay

Update/Display

L

%Action_UpdateDisplayAll

Update/Display All

C

%Action_Correction

Correction

E

%Action_DataEntry

Data Entry

Description

This system variable returns the navigator homepage permission list for the current user.

Description

%Node returns the name of the node from the current request object. This variable can only be used within a request (%Request). If you need to get the node name for a message, use the PubNodeName message property instead.

Description

This system variable returns a string representing the primary or base class of the current operator.

Note: This system variable is supported for compatibility with previous releases of PeopleTools. New applications should use %PermissionLists instead.

Related Links

%PermissionLists

Description

%OperatorId returns an uppercase character string containing the operator currently logged on. This is typically used to restrict access to records or fields to specific operators.

Note: This system variable is supported for compatibility with previous releases of PeopleTools. New applications should use %UserId instead.

Related Links

%UserId

Description

This system variable returns a string representing the row-level security class of the current operator. The row-level security class is now distinct from the operator’s primary class.

Note: This system variable is supported for compatibility with previous releases of PeopleTools. New applications should use %RowSecurityPermissionList instead.

Description

This meta-variable returns the current output destination format as a string.

Note: This is not a system variable. This is a meta-variable only available in a Application Engine program.

Description

This meta-variable returns the current output destination type as a string.

Note: This is not a system variable. This is a meta-variable only available in a Application Engine program.

Description

%Page returns an uppercase character string containing the current page name. It is typically used to restrict processing to a specific page, which is often necessary, because PeopleCode programs are associated with record definitions that can be shared by multiple pages.

Description

%Panel returns an uppercase character string containing the current panel name.

Note: This system variable is supported for compatibility with previous releases of PeopleTools. New applications should use %Page instead.

Related Links

%Page

Description

%PanelGroup returns an uppercase character string containing the name of the current component, as set in the component definition.

Note: This system variable is supported for compatibility with previous releases of PeopleTools. New applications should use %Component instead.

Related Links

%Component

Description

This system variable returns a Boolean indicating if the current user's password has expired. This system variable should be used after using SwitchUser, to verify if the password of the user that the user has just switched to is expired.

Related Links

SwitchUser

Description

Use the %PerfTime system variable to return the application server's local system time.

This variable returns only the local system time. This is different from the %Time system variable, which returns the system time from the database server, which may or may not be the same physical system as the application server.

PeopleSoft recommends using %PerfTime when measuring performance time for a specific PeopleCode program. This can enable developers to evaluate which coding logic has better performance time.

Note: Do not assume that %PerfTime returns the same time as the database server. Use %Time if you need to use a time value for your application transaction.

Example

The following is an example of how to use %PerfTime to check performance of a PeopleCode program:

&startTime = %PerfTime;

Local number &nbr;
Local Rowset &Table1_rs, &Table2_rs, &Table1_cpy_rs, &Table2_cpy_rs;
Local Rowset &Table1_vw_rs;


&Table1_rs = CreateRowset(Record.PTP_TABLE1);
&Table1_cpy_rs = CreateRowset(Record.PTP_TABLE1);
&Table1_rs.Fill("WHERE PTP_SEQ_NBR <= 10001");

REM
REM  Copy using Rowset function from one RowSet to Another
REM;

&Table1_rs.CopyTo(&Table1_cpy_rs);

REM
REM USE ROWSET TO READ RESULTS FROM A JOIN WITH BIND VARIABLE
REM;

&nbr = 10001;
&Table1_vw_rs = CreateRowset(Record.PTP_TABLE1_VW);
&Table1_vw_rs.Fill("WHERE PTP_SEQ_NBR >= :1", &nbr);

REM
REM  END OF EXERCISE CODE FOR PERFORMANCE COLLECTOR
REM;


&Rs = GetRowset(Scroll.PTP_TABLE1);

&Rs.Flush();
&Rs.Select(Record.PTP_TABLE1, "WHERE PTP_SEQ_NBR <= 10005");


&timeTaken = %PerfTime - &startTime;

Description

This system variable returns an array object containing entries for all the permission lists to which the current user belongs.

Note: Only permission list definition names and not permission list alias names are returned in the array.

Description

This system variable returns the process ID of the process that issues it as a number. For example, if an application server has a process ID of 445656 (as seen on task manager), this system variable would return 445656 for any PeopleCode that ran on that application server (that is, from a component.) Application Engine PeopleCode run on the Application Engine server, and so on.

Description

%Portal returns the name of the portal the current service is being accessed through, as a string. For example, suppose your PeopleCode is part of the page USERMAIN_SELF, in this URL:

http://serverx/servlets/psp/eprocurement/hrms/c/MAINTAINT_SECURITY.USERMAIN_SEF.GBL

This system variable returns the following:

eprocurement

Related Links

Understanding Nodes

Description

This system variable returns a string representing the primary permission list of the current user.

Description

This system variable returns the process profile Permission List for the current user.

Description

This system variable returns the result (True of False) of PeopleSoft ID and password authentication for the user signing on.

Description

%Request returns a reference to the request object. This reference can be used like an object, that is, you can use this as part of a dot notation string. For example:

&LOGOUT = %Request.LogoutURL;

This system variable is applicable only in an internet script.

Description

%Response returns a reference to the response object. This reference can be used like an object, that is, you can use this as part of a dot notation string. For example:

&CookieArray = %Response.CookieNames();

This system variable is applicable only in an internet script.

Description

This system variable returns a string containing an HTML document displayed to a user. This system variable is used with SwitchUser to pass any messages from the sign on process (or Signon PeopleCode) to the user.

Note: This system variable can be used only in Signon PeopleCode.

Related Links

SwitchUser

Description

This system variable returns an array object containing entries for all the roles to which the current user belongs.

Note: Only role definition names and not role alias names are returned in the array.

Description

This system variable returns a string representing the row-level PermissionList of the current user. The row-level security PermissionList is distinct from the user’s primary PermissionList.

Description

This system variable returns a Boolean value, letting you know if you're in the portal or not. This variable works in both frame templates and HTML templates.

Description

%ServerTimeZone returns the current time zone on the server as a three-character string.

Description

%Session returns a reference to the current, existing session. If you use %Session successfully, you do not have to use the GetSession function and Connect method. If you do not have a current session, %Session returns NULL.

Example

Local ApiObject &MySession

&MySession = %Session;
If Not (&MySession) Then
   /* Application level error handling */
End-If;

Description

%SignonUserId returns the value the user typed in at the sign on page.

Note: This system variable can be used only in Signon PeopleCode.

Description

%SignOnUserPswd returns the value the user typed in at the sign on page. This value is encrypted. This ensures end-user passwords can't be "captured" by a Signon PeopleCode program.

Note: This system variable can be used only in Signon PeopleCode.

Description

This system variable returns the email address used by Blackberry to reply to, as a string, based on value in the application server configuration file for SMTPBlackberryReplyTo. This value is used in the Blackberry Response processing when Notification Templates are used.

Description

This system variable returns a Boolean value, based on the value in the application server configuration file for SMTPGuaranteed. The values are:

Value in Configuration File

Value Returned by System Variable

0

False

1

True

When this value is set to True, the Notification Send method sends emails asynchronously by publishing an Application Message (EMAIL_MSG).

When this value is set to False, the Notification Send method sends emails synchronously by calling the SMTP server directly.

Description

This system variable returns an email address as a string. The value is based on the value in the application server configuration file for SMTPSender. This value is used as the default sender email address for the following emails:

  • TriggerBusinessEvent function

  • SendMail function

  • Notification class Send method

When using Notification Templates, if the Sender value is set to "System", this is the email address that is used for the Sender.

Description

%SQLRows returns the number of rows affected by the most recent UPDATE, DELETE, or INSERT executed through the SQLExec function.

%SQLRows can also be used after SELECT. It returns 0 if no rows are returned, a non-zero value if one or more rows are returned. In this case, the non-zero value does not indicate the total number of rows returned.

Description

%Super returns a reference to an object of the superclass.

A class that extends another class must have a constructor. In addition, the constructor method must include code to initialize its superclass by assigning the %Super system variable to an instance of the superclass. This assignment is allowed only in the constructor for the subclass.

Example

The following example shows this type of assignment:

class Example extends ExampleBase
   method Example();
   ...
end-class;

Global string &CurrentBaseString;

method Example
   %Super = create ExampleBase();
   &BaseString = &CurrentBaseString;
   &SlashString = &BaseString;
   &ImportantDate = Date(19970322);
end-method;

Description

%This returns a reference to the current object.

Example

In the following example, both Banana and Apple are defined as subclasses of Fruit. When implemented, the Slice method of each subclass will override the Slice method of the superclass. In addition, Banana defines a Freeze method not found in the superclass; similarly, Apple defines a Juice method not found in the superclass.

import FRUIT:Fruit;

class Banana extends FRUIT:Fruit
   method Banana();
   method Slice(&slices As number);
   method Freeze();
end-class;

method Banana
   %Super = create FRUIT:Fruit();
   %This.Color = "yellow";
end-method;

method Slice
   /+ &slices as Number +/
   /+ Extends/implements FRUIT:Fruit.Slice +/
end-method;

method Freeze
end-method;

---------------------------------------------
import FRUIT:Fruit;

class Apple extends FRUIT:Fruit
   method Apple();
   method Slice(&slices As number);
   method Juice();
end-class;

method Apple
   %Super = create FRUIT:Fruit();
   %This.Color = "red";
end-method;

method Slice
   /+ &slices as Number +/
   /+ Extends/implements FRUIT:Fruit.Slice +/
end-method;

method Juice
end-method;

Description

%Time retrieves the current database server time.

If your application deals with time-sensitive data, use this value. If you want to measure the performance of a PeopleCode program, use the %PerfTime system variable instead.

Description

%ToolsRelease returns a character string containing the PeopleTools release and patch version.

Example

MessageBox(0, "", 0, 0, "Current PeopleTools release is: %1", %ToolsRelease);

The message box would display Current PeopleTools release is: 8.55.22 on a PeopleSoft environment running PeopleTools 8.55 with patch version 22.

Description

This system variable returns a reference to the TransformData object. If you do not have a current TransformData object, %TransformData returns Null.

Description

This system variable returns the description (if any) listed for the current user.

Description

%UserId returns a character string containing the user currently logged on. This is typically used to restrict access to records or fields to specific users.

Description

%WLInstanceID returns a string containing the name of the Worklist Instance ID for the current worklist entry. It returns a blank string if the current page was not accessed using a worklist.

Description

%WLName returns a string containing the name of the Worklist for the current worklist entry. It returns a blank string if the current page was not accessed using a worklist.