The chapter provides an overview of system variables and then discusses each variable in detail.
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.
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
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
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
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.
See Also
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.
This is potentially one day different than the server date, which is returned with %Date.
See Also
Managing PeopleSoft Personalizations
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.
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.)
If you use this system variable in a mobile application, %CompIntfcName returns the name of the synchronizable Component Interface represented by the mobile object. An empty string is returned if no Component Interface is active.
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.
See Also
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.
Description
%DbServerName returns the name of the current Sybase or Informix database server as a string. This is not valid for other database types.
Description
%DbType returns a string representing the type of the current database. The valid values are:
APPSERVER
DB2
DB2UNIX
INFORMIX
MICROSFT
ORACLE
SYBASE
Note. Supported database platforms are subject to change.
Description
This system variable returns the type of the mobile device. The values are:
%MobileDevice_Laptop
%MobileDevice_PDA
%OtherDevice
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 Peoplesoft Application Engine program.
See Also
Using the Command Line to Invoke Application Engine Programs
Description
This system variable returns the name of the last homepage tab visited by the user 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.
See Also
Description
This system variable returns True if the current user is multi-language enabled.
See Also
Working With Language-Sensitive Application Data
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
Description
%Language_Base returns the base language for the current database, as set with the PeopleTools Options page.
See Also
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
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
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
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 PeopleSoft 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.
Description
%MaxInterlinkSize returns the current size limit of Interlink objects, as set on the PeopleTools Options page.
See Also
Description
%MaxMessageSize returns the current size limit of messages, as set on the PeopleTools Options page.
See Also
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
This system variable returns the name of the current mobile page.
Example
%ThisMobileObject.QE_MB_RESULTS = %MobilePage;
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.
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 with in a request (%Request). If you need to get the node name for a message, use the PubNodeName message property instead.
See Also
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
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
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
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 Peoplesoft Application Engine program.
See Also
Using the Command Line to Invoke Application Engine Programs
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 Peoplesoft Application Engine program.
See Also
Using the Command Line to Invoke Application Engine Programs
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.
See Also
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
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
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
Description
This system variable returns an array object containing entries for all the permission lists to which the current user belongs.
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
See Also
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.
See Also
Internet Script Classes (iScript).
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).
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
Description
This system variable returns an array object containing entries for all the roles to which the current user belongs.
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 don't have to use the GetSession function and Connect method. If you don't have a current session, %Session returns NULL.
Example
Local ApiObject &MySession &MySession = %Session; If Not (&MySession) Then /* Application level error handling */ End-If;
The following example is used with in a mobile application:
Local ApiObject &ob, &Session; Local ApiObject &PropertyInfo; &ob = %ThisMobileObject; &Session = %Session; &SaveCustomer = %ThisMobileObject.MyFavoriteCustomer; &Customer = %Session.GetCompIntfc(COMPINTFC.CUSTOMER); &Customer.Name="Acme Applicances";
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.
See Also
Designing BlackBerry Email Responses
Description
This system variable returns a Boolean value, based on 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 SendMail built-in function and the Notification Send method send emails asynchronously by publishing an Application Message (EMAIL_MSG).
When this value is set to False, the SendMail built-in function and the Notification Send method send emails synchronously by calling the SMTP server directly.
See Also
Designing BlackBerry Email Responses
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.
See Also
Designing BlackBerry Email Responses
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
This system variable returns a reference to the SyncServer object. If you don't have a current SyncServer object, %SyncServer returns NULL.
See Also
Description
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
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
Description
This system variable returns a reference to the TransformData object. If you don't have a current TransformData object, %TransformData returns Null.
See Also
Applying Filtering, Transformation and Translation
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.