System Variables

The chapter provides an overview of system variables and then discusses each variable in detail.

Click to jump to parent topicUnderstanding System Variables

PeopleTools provides a number of system variables that provide access to system information. System variables are prefixed with the ‘%’ character, rather than the ‘&’ character. You can use these system variables wherever you can use a constant, passing them as parameters to functions or assigning their values to fields or to temporary variables.

In this section, we discuss each system variable.

Click to jump to top of pageClick to jump to parent topic%AllowNotification

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.

See Also

Understanding PeopleSoft Security

Click to jump to top of pageClick to jump to parent topic%AllowRecipientLookup

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.

See Also

Understanding PeopleSoft Security

Click to jump to top of pageClick to jump to parent topic%ApplicationLogFence

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;

See Also

WriteToLog

Using Application Logging

Click to jump to top of pageClick to jump to parent topic%AsOfDate

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.

Click to jump to top of pageClick to jump to parent topic%AuthenticationToken

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.

See Also

SwitchUser.

AuthTokenDomain

Click to jump to top of pageClick to jump to parent topic%BPName

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.

Click to jump to top of pageClick to jump to parent topic%ClientDate

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.

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

See Also

%Date

Managing PeopleSoft Personalizations

Click to jump to top of pageClick to jump to parent topic%ClientTimeZone

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.

See Also

Managing PeopleSoft Personalizations.

Click to jump to top of pageClick to jump to parent topic%Component

Description

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

Click to jump to top of pageClick to jump to parent topic%CompIntfcName

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.

Click to jump to top of pageClick to jump to parent topic%ContentID

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

Click to jump to top of pageClick to jump to parent topic%ContentType

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

Click to jump to top of pageClick to jump to parent topic%Copyright

Description

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

Click to jump to top of pageClick to jump to parent topic%Currency

Description

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

Click to jump to top of pageClick to jump to parent topic%Date

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.

See Also

%ClientDate.

Click to jump to top of pageClick to jump to parent topic%DateTime

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.

Click to jump to top of pageClick to jump to parent topic%DbName

Description

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

Click to jump to top of pageClick to jump to parent topic%DbServerName

Description

%DbServerName returns the name of the current Sybase or Informix database server as a string. This is not valid for other database types.

Click to jump to top of pageClick to jump to parent topic%DbType

Description

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

Note. Supported database platforms are subject to change.

Click to jump to top of pageClick to jump to parent topic%DeviceType

Description

Note. PeopleSoft Mobile Agent is a deprecated product. This system variable currently exists for backward compatibility only.

This system variable returns the type of the mobile device. The values are:

Click to jump to top of pageClick to jump to parent topic%EmailAddress

Description

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

Click to jump to top of pageClick to jump to parent topic%EmployeeId

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.

Click to jump to top of pageClick to jump to parent topic%ExternalAuthInfo

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.

Click to jump to top of pageClick to jump to parent topic%FilePath

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.

See Also

Using the Command Line to Invoke Application Engine Programs

Click to jump to top of pageClick to jump to parent topic%HPTabName

Description

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

Click to jump to top of pageClick to jump to parent topic%Import

Description

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

Click to jump to top of pageClick to jump to parent topic%IntBroker

Description

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

See Also

IntBroker Class

Click to jump to top of pageClick to jump to parent topic%IsMultiLanguageEnabled

Description

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

See Also

Working With Language-Sensitive Application Data

Click to jump to top of pageClick to jump to parent topic%Language

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.

See Also

%Language_User

SetLanguage

Click to jump to top of pageClick to jump to parent topic%Language_Base

Description

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

See Also

PeopleTools Options

Click to jump to top of pageClick to jump to parent topic%Language_Data

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.

See Also

%Language_User.

Click to jump to top of pageClick to jump to parent topic%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.

See Also

SetLanguage.

Click to jump to top of pageClick to jump to parent topic%LocalNode

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

See Also

Adding and Configuring Nodes

Click to jump to top of pageClick to jump to parent topic%Market

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.

See Also

Creating Component Definitions.

Click to jump to top of pageClick to jump to parent topic%MaxMessageSize

Description

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

See Also

PeopleTools Options

Click to jump to top of pageClick to jump to parent topic%Menu

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.

Click to jump to top of pageClick to jump to parent topic%MobilePage

Description

Note. PeopleSoft Mobile Agent is a deprecated product. This system variable currently exists for backward compatibility only.

This system variable returns the name of the current mobile page.

Example

%ThisMobileObject.QE_MB_RESULTS = %MobilePage;

Click to jump to top of pageClick to jump to parent topic%Mode

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

P

%Action_Prompt

Prompt

Note. This system variable is not valid with mobile PeopleCode.

Click to jump to top of pageClick to jump to parent topic%NavigatorHomePermissionList

Description

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

Click to jump to top of pageClick to jump to parent topic%Node

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.

See Also

Adding and Configuring Nodes

PubNodeName

Click to jump to top of pageClick to jump to parent topic%OperatorClass

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.

See Also

%PermissionLists.

Click to jump to top of pageClick to jump to parent topic%OperatorId

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.

See Also

%UserId.

Click to jump to top of pageClick to jump to parent topic%OperatorRowLevelSecurityClass

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.

See Also

%RowSecurityPermissionList.

Click to jump to top of pageClick to jump to parent topic%OutDestFormat

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.

See Also

Using the Command Line to Invoke Application Engine Programs

Click to jump to top of pageClick to jump to parent topic%OutDestType

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.

See Also

Using the Command Line to Invoke Application Engine Programs

Click to jump to top of pageClick to jump to parent topic%Page

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.

Click to jump to top of pageClick to jump to parent topic%Panel

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.

See Also

%Page.

Click to jump to top of pageClick to jump to parent topic%PanelGroup

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.

See Also

%Component.

Click to jump to top of pageClick to jump to parent topic%PasswordExpired

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.

See Also

SwitchUser.

Click to jump to top of pageClick to jump to parent topic%PerfTime

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;

See Also

%Time

Click to jump to top of pageClick to jump to parent topic%PermissionLists

Description

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

Click to jump to top of pageClick to jump to parent topic%PID

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.

Click to jump to top of pageClick to jump to parent topic%Portal

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

See Also

Adding and Configuring Nodes

Click to jump to top of pageClick to jump to parent topic%PrimaryPermissionList

Description

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

Click to jump to top of pageClick to jump to parent topic%ProcessProfilePermissionList

Description

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

Click to jump to top of pageClick to jump to parent topic%PSAuthResult

Description

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

Click to jump to top of pageClick to jump to parent topic%Request

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.

See Also

Internet Script Classes (iScript).

Click to jump to top of pageClick to jump to parent topic%Response

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.

See Also

Internet Script Classes (iScript).

Click to jump to top of pageClick to jump to parent topic%ResultDocument

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.

See Also

SwitchUser.

Click to jump to top of pageClick to jump to parent topic%Roles

Description

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

Click to jump to top of pageClick to jump to parent topic%RowSecurityPermissionList

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.

Click to jump to top of pageClick to jump to parent topic%RunningInPortal

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.

Click to jump to top of pageClick to jump to parent topic%ServerTimeZone

Description

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

Click to jump to top of pageClick to jump to parent topic%Session

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;

Click to jump to top of pageClick to jump to parent topic%SignonUserId

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.

Click to jump to top of pageClick to jump to parent topic%SignOnUserPswd

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.

Click to jump to top of pageClick to jump to parent topic%SMTPBlackberryReplyTo

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.

See Also

Designing BlackBerry Email Responses

Click to jump to top of pageClick to jump to parent topic%SMTPGuaranteed

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.

See Also

SendMail, Send.

Designing BlackBerry Email Responses

Click to jump to top of pageClick to jump to parent topic%SMTPSender

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:

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

See Also

Designing BlackBerry Email Responses

Click to jump to top of pageClick to jump to parent topic%SQLRows

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.

Click to jump to top of pageClick to jump to parent topic%SyncServer

Description

Note. PeopleSoft Mobile Agent is a deprecated product. This system variable currently exists for backward compatibility only.

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

See Also

SyncServer Class

Click to jump to top of pageClick to jump to parent topic%ThisMobileObject

Description

Note. PeopleSoft Mobile Agent is a deprecated product. This system variable currently exists for backward compatibility only.

Returns a reference to the current mobile object, which is the equivalent of a row for a Component Interface object.

To get the top level object, use %ThisMobileObject.GetTopParent.

To get the immediate parent, use %ThisMobileObject.GetParent.

Example

Local ApiObject &ob, &Session; Local ApiObject &PropertyInfo; &ob = ​%ThisMobileObject; &Session = %Session; /************************************************************* * Set properties directly on %ThisMobileObject * *************************************************************/ ​%ThisMobileObject.date = "2002.12.06"; ​%ThisMobileObject.time = "10:30:00";

See Also

Mobile Classes

Click to jump to top of pageClick to jump to parent topic%Time

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.

See Also

%PerfTime.

Click to jump to top of pageClick to jump to parent topic%TransformData

Description

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

See Also

Applying Filtering, Transformation and Translation

Understanding the TransformData Class

Click to jump to top of pageClick to jump to parent topic%UserDescription

Description

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

Click to jump to top of pageClick to jump to parent topic%UserId

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.

Click to jump to top of pageClick to jump to parent topic%WLInstanceID

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.

Click to jump to top of pageClick to jump to parent topic%WLName

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.