PeopleCode Built-in Functions and Language Constructs: G

The PeopleCode built-In functions and language constructs beginning with the letter G are listed in alphabetical order within this topic.

Syntax

GenABNNodeURL(node,initial_node,display_parent)

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use the GenABNNodeURL function to generate a URL for a specific node within a SmartNavigation chart.

Important! This function must be called during a user action that displays the SmartNavigation chart—for example, when the user clicks on a folder icon from the menu or when the user clicks on the first description link of a SmartNavigation chart node. Otherwise, the function returns an empty string.

Parameters

Field or Control

Definition

node

Specify the ID of the node to be displayed as a string.

initial_node

Specify the ID of the initial node of the SmartNavigation chart as a string.

display_parent

A Boolean value indicating whether the node to be displayed requires that its parent node also be displayed in the chart.

Returns

A string representing the URL to navigate to the specified node.

Syntax

GetComponentTitle()

Description

Use the GetComponentTitle function to return the name of the component (from the component definition).

Important! Use this function within fluid applications only.

Parameters

None.

Returns

A String value.

Example

&sPageTitle = GetComponentTitle();

Syntax

GenDynABNElement(&str_param1[,&str_param2], ...)

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use the GenDynABNElement function to generate <li> elements for the specified data source to be used as a dynamically generated SmartNavigation subfolder. This built-in function is required when the root SmartNavigation folder is designated as a “dynamic hierarchy” folder on the Folder Administration page.

The <li> elements generated by this function can be provided as the input to the GenHTMLMenu function. Alternatively, the output of one invocation of GenDynABNElement can be concatenated to subsequent invocations prior to calling the GenHTMLMenu function.

Parameters

Field or Control

Definition

&str_param1, &str_param2, ...

Specifies the first and additional input parameters to the function as string variables.

Note: Each string parameter can be specified as a string literal or a string variable.

While this function can accept an unlimited number of string parameters, in practical terms, the function expects a specific number of string parameters in a specific order depending on whether the data source for the dynamically generated SmartNavigation subfolder is a tree or a rowset.

When the data source for the SmartNavigation subfolder is a tree, 11 string parameters are required in the following order with the following specifications:

  • Data source type – For a tree, this parameter must be "t".

  • Display as CREF – Indicates that the SmartNavigation folder is to be displayed as a CREF, which immediately displays the SmartNavigation chart, instead of as a folder with submenus. Specify as false = "f"; true = "t".

  • Folder ID – Specifies a programmatically generated folder ID. For example: "PRS_DATA_001".

  • Folder label – Specifies the label to display for this subfolder in the SmartNavigation menu drop-downs, fly-outs, and breadcrumbs. For example: "Personnel Data".

  • Chart component – Specifies the page used to render the SmartNavigation chart in the following format: COMPONENT.PAGE.MKT.

  • PeopleCode ID – Specifies the PeopleCode program to run to generate the SmartNavigation elements for the specified data source. The PeopleCode ID must be in the following format: APP_PKG.Class.Method.

  • Tree name – Specifies the name for the tree. For example: "PERS_DATA".

  • Tree setID – Specifies the setID for the tree. For example: "SHARE".

  • Tree user key – Specifies the user key value for the tree (also known as the set control value). An actual value is optional but must be specified as the null string: "".

  • Tree effective date – Specifies the effective date for the tree. An actual value is optional but must be specified as the null string: "".

  • Tree branch – Specifies the tree branch. An actual value is optional but must be specified as the null string: "".

SmartNavigation passes the values of several tree-specific fields to the application via URL. Certain characters are inappropriate for use in a URL and must be avoided. When using a tree as a SmartNavigation data source, do not use any of the following characters in the tree name, setID, user key value, and tree branch values:

pound (#)

percent (%)

dollar ($)

ampersand (&)

plus (+)

comma (,)

forward slash/virgule (/)

colon (:)

semi-colon (;)

equals (=)

question mark (?)

at symbol (@)

space ( )

quotation marks(")

less than symbol (<)

greater than symbol (>)

left curly brace ({)

right curly brace (})

vertical bar/pipe (|)

backslash (\)

caret (^)

tilde (~)

left square bracket ([)

right square bracket (])

grave accent (`)

For example:

rem Create SmartNavigation dynamic folder from a tree;
&fldr = GenDynABNElement(&ds_t, &cref_t, &fldr_id, &label_t, &chart_t, &pcode_t, &tree_name, &tree_setid, &tree_userkey, &tree_effdt, &tree_branch);

When the data source for the SmartNavigation subfolder is a rowset, 6 string parameters are required in the following order with the following specifications:

  • Data source type – For a rowset, this parameter must be "r".

  • Display as CREF – Indicates that the SmartNavigation folder is to be displayed as a CREF, which immediately displays the SmartNavigation chart, instead of as a folder with submenus. Specify as false = "f"; true = "t".

  • Folder ID – Specifies a programmatically generated folder ID. For example: "PRS_DATA_001".

  • Folder label – Specifies the label to display for this subfolder in the SmartNavigation menu drop-downs, fly-outs, and breadcrumbs. For example: "Personnel Data".

  • Chart component – Specifies the page used to render the SmartNavigation chart in the following format: COMPONENT.PAGE.MKT.

  • PeopleCode ID – Specifies the PeopleCode program to run to generate the SmartNavigation elements for the specified data source. The PeopleCode ID must be in the following format: APP_PKG.Class.Method.

For example:

rem Create SmartNavigation dynamic folder from a rowset;
&fldr = GenDynABNElement(&ds_r, &cref_r, &fldr_id, &label_r, &chart_r, &pcode_r);

Returns

A string representing the <li> elements for the data source.

Syntax

GenerateActGuideContentlUrl(PORTAL.portalname, NODE.nodename, MENUNAME.menuname, Marketname, COMPONENT.componentname, ActivityGuide) 

Description

Use the GenerateActGuideContentUrl function to create a URL string that represents an absolute reference to the specified Workflow activity guide for the content servlet. The ContentURI of the node that hosts the specified portal is used in the generated URL. The URL contains a reference to the content service (psc) servlet.

If you want to generate a URL for the portal service (psp) servlet, use the GenerateActGuidePortalURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the activity guide, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

menuname

Specify the name of the menu containing the activity guide, prefixed with the reserved word MENUNAME. You can also use a string, such as %Menu, for this value.

Marketname

Specify the name of the market of the component. You can also use a string, such as %Market, for this value.

ComponentName

Specify the name of the component, prefixed with the reserved word COMPONENT. You can also use a string, such as %Component, for this value.

ActivityGuide

Specify the name of the Workflow activity guide as a string.

Returns

A string with the following format:

http://Content URI of node/portal/node/l/ActivityGuide.component.market

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&AGURL = GenerateActGuideContentUrl(%Portal, %Node, MENUNAME.MAINTAIN_SECURITY, "GBL", COMPONENT.CHANGE_PASSWORD, "QE_ACTIVITY_GUIDE_DEMO");

might produce the following URL string:

http://boynten8700/psc/ps/EMPLOYEE/QE_LOCAL/l/QE_ACTIVITY_GUIDE_DEMO.MAINTAIN_
SECURITY.CHANGE_PASSWORD.GBL

Syntax

GenerateActGuidePortalUrl(PORTAL.portalname, NODE.nodename, MENUNAME.menuname, Marketname, COMPONENT.componentname, ActivityGuide)

Description

Use the GenerateActGuidePortalUrl function to create a URL string that represents an absolute reference to the specified Workflow activity guide for the portal servlet. The PortalURI of the node that hosts the specified portal is used in the generated URL. The URL contains a reference to the portal service (psp) servlet.

If you want to generate a URL for the portal content (psc) servlet, use the GenerateActGuideContentURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the activity guide, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

menuname

Specify the name of the menu containing the activity guide, prefixed with the reserved word MENUNAME. You can also use a string, such as %Menu, for this value.

Marketname

Specify the name of the market of the component. You can also use a string, such as %Market, for this value.

ComponentName

Specify the name of the component, prefixed with the reserved word COMPONENT. You can also use a string, such as %Component, for this value.

ActivityGuide

Specify the name of the Workflow activity guide as a string.

Returns

A string with the following format:

http://Portal URI of node/portal/node/l/ActivityGuide.component.market

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&AGURL = GenerateActGuidePortalUrl(%Portal, %Node, MENUNAME.MAINTAIN_SECURITY,
 "GBL", COMPONENT.CHANGE_PASSWORD, "QE_ACTIVITY_GUIDE_DEMO");

might create the following URL string:

http://boynte700/psp/ps/EMPLOYEE/QE_LOCAL/l/QE_ACTIVITY_GUIDE_DEMO.MAINTAIN_
SECURITY.CHANGE_PASSWORD.GBL

Syntax

GenerateActGuideRelativeUrl(PORTAL.portalname, NODE.nodename, MENUNAME.menuname, Marketname, COMPONENT.componentname, ActivityGuide)

Description

Use the GenerateActGuideContentUrl function to create a URL string that represents an relative reference to the specified Workflow activity guide. The relative reference is suitable for use on any page that itself has the simple URL format.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the activity guide, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

menuname

Specify the name of the menu containing the activity guide, prefixed with the reserved word MENUNAME. You can also use a string, such as %Menu, for this value.

Marketname

Specify the name of the market of the component. You can also use a string, such as %Market, for this value.

ComponentName

Specify the name of the component, prefixed with the reserved word COMPONENT. You can also use a string, such as %Component, for this value.

ActivityGuide

Specify the name of the Workflow activity guide as a string.

Returns

A string with the following format:

../../../Portal/node/l/ActivityGuide.menu.component.market

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&AGURL = GenerateActGuideRelativeUrl(%Portal, %Node, MENUNAME.MAINTAIN_SECURITY,
 "GBL", COMPONENT.CHANGE_PASSWORD, "QE_ACTIVITY_GUIDE_DEMO");

might produce the following URL string:

../../../EMPLOYEE/QE_LOCAL/l/QE_ACTIVITY_GUIDE_DEMO.MAINTAIN_SECURITY.CHANGE_
PASSWORD.GBL

Syntax

GenerateComponentContentRelURL(PORTAL.portalname, NODE.nodename, MENUNAME.menuname, MARKET.marketname, COMPONENT.componentname, PAGE.pagename, action, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2].
. .

OR

&RecordObject1 [, &RecordObject2].  .  .

Description

Use the GenerateComponentContentRelURL function to create a URL string that represents a relative reference to the specified component for the content servlet. The relative reference is suitable for use on any page that itself has the simple URL format.

If you want to generate an absolute URL for a component, use the GenerateComponentContentURL function.

Note: PeopleSoft recommends using the Transfer function for opening new windows, not this function, as there may be problems maintaining state and window count.

Parameters

Field or Control

Definition

PortalName

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value. This parameter is ignored by the content service, but is a required part of the psc URL format.

NodeName

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

MenuName

Specify the name of the menu containing the content, prefixed with the reserved word MENUNAME. You can also use a string, such as %Menu, for this value.

Marketname

Specify the name of the market of the component, prefixed with the reserved word MARKET. You can also use a string, such as %Market, for this value.

ComponentName

Specify the name of the component, prefixed with the reserved word COMPONENT. You can also use a string, such as %Component, for this value.

Pagename

Specify the name of the page that contains the content. If you specify a page name, it must be prefixed with the keyword PAGE. You can also specify an empty string ("") for this value.

Action

Specify a single-character code. Valid actions are:

  • "A" ( add)

  • "U" (update)

  • "L" (update/display all)

  • "C" (correction)

  • "E" (data entry)

You can also specify an empty string ("") for this value.

Keylist

An optional list of field specifications used to select a unique row at level zero in the page you are transferring to, by matching keys in the page you are transferring from. It can also be an already instantiated record object.

If a record object is specified, any field of that record object that is also a field of the search record for the destination component is added to keylist. The keys in the fieldlist must uniquely identify a row in the "to" page search record. If a unique row is not identified, of if Force Search Processing has been selected, the search dialog appears.

If the keylist parameter is not supplied the destination component's search key must be found as part of the source components level 0 record buffer.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

../../../Portal/node/c/menu.component.market?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

../../../portal/node/?ICType=Panel&Menu=menu&Market=market&PanelGroupName=component?parameters

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&MyCompURL = GenerateComponentContentRelURL("EMPLOYEEPORTAL", "CRM", MenuName.SFA,
 "GBL", Component.CUSTOMERINFO, Page.CUST_DATA1, "U", EMPLID); 

Might create the following URL:

../../../psc/PS84/EMPLOYEEPORTAL/CRM/c/SFA.CUSTOMERINFO.GBL?page=
CUST_DATA1&&Action=U&emplid=00001

Because this function terminates if the portal or node name is invalid, it's enclosed in a try-catch section so if an exception gets raised, it can be handled.

try 
   &MyURL = GenerateComponentContentRelURL(%Portal, "HRMS", Menuname.ADMIN_
WORKFORCE, "GBL", Component.ABSENCE_HISTORY, Page. ABSENCE_HISTORY, "U", EMPLID) 
 
   catch ExceptionPortal &Ex1 
      /* error handling portal name not valid */ 
   catch ExceptionNode &Ex2 
      /* error handling Node name not valid */ 
 
end-try;

Syntax

GenerateComponentContentURL(PORTAL.portalname, NODE.nodename, MENUNAME.menuname, MARKET.marketname, COMPONENT.componentname, PAGE.pagename, action, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2].
. .

OR

&RecordObject1 [, &RecordObject2].  .  .

Description

Use the GenerateComponentContentURL function to create a URL string that represents an absolute reference to the specified component for the content servlet.

The ContentURI of the specified node is used in the generated URL. The URL contains a reference to the portal content (psc) servlet. If you want to generate a URL for the portal service (psp), use the GenerateComponentPortalURL function.

Parameters

Field or Control

Definition

PortalName

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value. This parameter is ignored by the content service, but is a required part of the psc URL format.

NodeName

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

MenuName

Specify the name of the menu containing the content, prefixed with the reserved word MENUNAME. You can also use a string, such as %Menu, for this value.

Marketname

Specify the name of the market of the component, prefixed with the reserved word MARKET. You can also use a string, such as %Market, for this value.

ComponentName

Specify the name of the component, prefixed with the reserved word COMPONENT. You can also use a string, such as %Component, for this value.

Pagename

Specify the name of the page that contains the content. If you specify a page name, it must be prefixed with the keyword PAGE. You can also specify an empty string ("") for this value.

Action

Specify a single-character code. Valid actions are:

  • "A" ( add)

  • "U" (update)

  • "L" (update/display all)

  • "C" (correction)

  • "E" (data entry)

You can also specify an empty string ("") for this value.

Keylist

An optional list of field specifications used to select a unique row at level zero in the page you are transferring to, by matching keys in the page you are transferring from. It can also be an already instantiated record object.

If a record object is specified, any field of that record object that is also a field of the search record for the destination component is added to keylist. The keys in the fieldlist must uniquely identify a row in the "to" page search record. If a unique row is not identified, of if Force Search Processing has been selected, the search dialog appears.

If the keylist parameter is not supplied the destination component's search key must be found as part of the source components level 0 record buffer.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

http://Content URI of host node/Portal/node/c/menu.component.market?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

http://Content URI of host node/portal/node/?ICType=Panel&Menu=menu&Market=market
&PanelGroupName=component?parameters

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&MyCompURL = GenerateComponentContentURL("EMPLOYEEPORTAL", "CRM", MenuName.SFA,
 "GBL", Component.CUSTOMERINFO, Page.CUST_DATA1, "U", EMPLID); 

Might create the following URL:

http://serverx/servlets/psc/PS84/EMPLOYEEPORTAL/CRM/c/SFA.CUSTOMERINFO.GBL?page=
CUST_DATA1&&Action=U&emplid=00001

Because this function terminates if the portal or node name is invalid, it's enclosed in a try-catch section so if an exception gets raised, it can be handled.

try 
   &MyURL = GenerateComponentContentURL(%Portal, "HRMS", Menuname.ADMIN_WORKFORCE,
 "GBL", Component.ABSENCE_HISTORY, Page. ABSENCE_HISTORY, "U", EMPLID) 
 
   catch ExceptionPortal &Ex1 
      /* error handling portal name not valid */ 
   catch ExceptionNode &Ex2 
      /* error handling Node name not valid */ 
 
end-try;

Syntax

GenerateComponentPortalRelURL(PORTAL.portalname, NODE.nodename, MENUNAME.menuname, MARKET.marketname, COMPONENT.componentname, PAGE.pagename, action, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2].
. .

OR

&RecordObject1 [, &RecordObject2].  .  .

Description

Use the GenerateComponentPortalRelURL function to create a URL string URL string that represents a relative reference the specified content (component). The relative reference is suitable for use on any page that itself has the simple URL format.

If you want to generate an absolute URL for a component, use the GenerateComponentPortalURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

menuname

Specify the name of the menu containing the content, prefixed with the reserved word MENUNAME. You can also use a string, such as %Menu, for this value.

Marketname

Specify the name of the market of the component, prefixed with the reserved word MARKET. You can also use a string, such as %Market, for this value.

ComponentName

Specify the name of the component, prefixed with the reserved word COMPONENT. You can also use a string, such as %Component, for this value.

pagename

Specify the name of the page that contains the content. If you specify a page name, it must be prefixed with the keyword PAGE. You can also specify a Null string ("") for this value.

action

Specify a single-character code. Valid actions are:

  • "A" ( add)

  • "U" (update)

  • "L" (update/display all)

  • "C" (correction)

  • "E" (data entry)

You can also specify a Null string ("") for this value.

keylist

An optional list of field specifications used to select a unique row at level zero in the page you are transferring to, by matching keys in the page you are transferring from. It can also be an already instantiated record object.

If a record object is specified, any field of that record object that is also a field of the search record for the destination component is added to keylist. The keys in the fieldlist must uniquely identify a row in the "to" page search record. If a unique row is not identified, of if Force Search Processing has been selected, the search dialog appears.

If the keylist parameter is not supplied the destination component's search key must be found as part of the source components level 0 record buffer.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

../../../portal/node/c/menu.component.market?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

../../../portal/node/?ICType=Panel&Menu=menu&Market=market&PanelGroupName=component?parameters

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&MyCompURL = GenerateComponentPortalRelURL("EMPLOYEEPORTAL", "CRM", MenuName.SFA,
 "GBL", Component.CUSTOMERINFO, , "", "");

Might create the following URL:

../../../EMPLOYEEPORTAL/CRM/c/sfa.customerinfo.gbl

Syntax

GenerateComponentPortalURL(PORTAL.portalname, NODE.nodename, MENUNAME.menuname, MARKET.marketname, COMPONENT.componentname, PAGE.pagename, action, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2].
. .

OR

&RecordObject1 [, &RecordObject2].  .  .

Description

Use the GenerateComponentPortalURL function to create a URL string that represents an absolute reference to the specified component for the portal servlet. The PortalURI of the node that hosts the specified portal is used in the generated URL. The URL contains a reference to the portal service (psp) servlet.

If you want to generate a URL for the portal content (psc) servlet, use the GenerateComponentContentURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

menuname

Specify the name of the menu containing the content, prefixed with the reserved word MENUNAME. You can also use a string, such as %Menu, for this value.

Marketname

Specify the name of the market of the component, prefixed with the reserved word MARKET. You can also use a string, such as %Market, for this value.

ComponentName

Specify the name of the component, prefixed with the reserved word COMPONENT. You can also use a string, such as %Component, for this value.

pagename

Specify the name of the page that contains the content. If you specify a page name, it must be prefixed with the keyword PAGE. You can also specify a Null string ("") for this value.

action

Specify a single-character code. Valid actions are:

  • "A" ( add)

  • "U" (update)

  • "L" (update/display all)

  • "C" (correction)

  • "E" (data entry)

You can also specify a Null string ("") for this value.

keylist

An optional list of field specifications used to select a unique row at level zero in the page you are transferring to, by matching keys in the page you are transferring from. It can also be an already instantiated record object.

If a record object is specified, any field of that record object that is also a field of the search record for the destination component is added to keylist. The keys in the fieldlist must uniquely identify a row in the "to" page search record. If a unique row is not identified, of if Force Search Processing has been selected, the search dialog appears.

If the keylist parameter is not supplied the destination component's search key must be found as part of the source components level 0 record buffer.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

http://Portal URI of host node/portal/node/c/menu.component.market?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

http://Portal URI of host node/portal/node/?ICType=Panel&Menu=menu&Market=market&PanelGroupName=component?parameters

Note: If the host node is local, then Portal URI of host node will always be the one you're currently logged in as.

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&MyCompURL = GenerateComponentPortalURL("EMPLOYEEPORTAL", "CRM", MenuName.SFA,
 "GBL", Component.CUSTOMERINFO, , "", "");

Might create the following URL:

http://mike.com/servlets/psp/testsite/EMPLOYEEPORTAL/CRM/c/sfa.customerinfo.gbl

The following example uses a de-referenced name for the component.

&sComponent = "Component." | &sComponent; 
&sPage = "Page.EM_VCHR_PYMNT_CLN"; 
    
&rwCurrent = GetRow(); 
/*- The Search Record keys -*/ 
&sQueryString = &sQueryString | "&BUSINESS_UNIT=" | &rwCurrent.EM_VCHR_INQ_VW.EM_
BUSINESS_UNIT.Value; 
&sQueryString = &sQueryString | "&VOUCHER_ID=" | 
&rwCurrent.EM_VCHR_INQ_VW.VOUCHER_ID.Value; 
 
&sQueryString = GenerateComponentPortalURL(%Portal, %Node, 
MenuName.EM_BILL_PRESENTMENT, %Market, @&sComponent, @&sPage, "U") | 
&sQueryString; 
 
%Response.RedirectURL(&sURL);

Syntax

GenerateComponentRelativeURL(PORTAL.portalname, NODE.nodename, MENUNAME.menuname, MARKET.marketname, COMPONENT.componentname, PAGE.pagename, action, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2].
. .

OR

&RecordObject1 [, &RecordObject2].  .  .

Description

Use the GenerateComponentRelativeURL function to create a URL string that represents a relative reference the specified content (component). The relative reference is suitable for use on any page that itself has the simple URL format.

If you want to generate an absolute URL for a component, use either the GenerateComponentContentURL or GenerateComponentPortalURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

menuname

Specify the name of the menu containing the content, prefixed with the reserved word MENUNAME. You can also use a string, such as %Menu, for this value.

Marketname

Specify the name of the market of the component, prefixed with the reserved word MARKET. You can also use a string, such as %Market, for this value.

ComponentName

Specify the name of the component, prefixed with the reserved word COMPONENT. You can also use a string, such as %Component, for this value.

Pagename

Specify the name of the page that contains the content. If you specify a page name, it must be prefixed with the keyword PAGE. You can also specify a Null string ("") for this value.

Action

Specify a single-character code. Valid actions are:

  • "A" ( add)

  • "U" (update)

  • "L" (update/display all)

  • "C" (correction)

  • "E" (data entry)

You can also specify a Null string ("") for this value.

Keylist

An optional list of field specifications used to select a unique row at level zero in the page you are transferring to, by matching keys in the page you are transferring from. It can also be an already instantiated record object.

If a record object is specified, any field of that record object that is also a field of the search record for the destination component is added to keylist. The keys in the fieldlist must uniquely identify a row in the "to" page search record. If a unique row is not identified, of if Force Search Processing has been selected, the search dialog appears.

If the keylist parameter is not supplied the destination component's search key must be found as part of the source components level 0 record buffer.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

../../../portal/node/c/menu.component.market?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

../../../portal/node/?ICType=Panel&Menu=menu&Market=market&PanelGroupName=component?parameters

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code example:

&MyCompURL = GenerateComponentRelativeURL("EMPLOYEEPORTAL", "CRM", MenuName.SFA,
 "GBL", Component.CUSTOMERINFO, "", ""); 

Might yield the following:

../../../EMPLOYEEPORTAL/CRM/c/sfa.customerinfo.gbl

Syntax

GenerateExternalPortalURL(PORTAL.portalname, NODE.nodename, URL) 

Description

Use the GenerateExternalPortalURL function to create a URL string that represents an absolute reference the specified external content (URL) on the portal servlet.

The PortalURI of the node that hosts the specified portal is used in the generated URL. The generated URL contains a reference to the portal service (psp) servlet.

If you want to generate a relative URL, use the GenerateExternalRelativeURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

NodeName

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

URL

Specify the URL to be used for this content.

Returns

A string of the following format is returned:

http://Portal URI of host node/Portal/node/e/encodedURL

When the portal servlet evaluates an external URL, the Node is ignored, so %Node can always be passed in for the Node parameter.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&url = GenerateExternalPortalURL("EMPLOYEEPORTAL", "CRM", "http://www.excite.com");

Might create the following URL:

http://myserver/psp/ps/EMPLOYEEPORTAL/CRM/e/http%3a%2f%2fwww.excite.com

Syntax

GenerateExternalRelativeURL(PORTAL.portalname, NODE.nodename, EncodedURL) 

Description

Use the GenerateExternalRelativeURL function to create a URL string that represents a relative reference the specified external content (URL). The relative reference is suitable for use on any page that itself has the simple URL format and which is served by the portal servlet (psp).

If you want to generate an absolute URL, use the GenerateExternalPortalURL function.

Parameters

Field or Control

Definition

PortalName

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

NodeName

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

EncodedURL

Specify the URL to be used for this content.

Returns

A string of the following format is returned:

../../../Portal/node/e/encodedURL

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&url = GenerateExternalRelativeURL("EMPLOYEEPORTAL", "CRM", "http:
//www.excite.com");

Might create the following URL:

../../../EMPLOYEEPORTAL/CRM/e/http%3a%2f%2fwww.excite.com

Syntax

GenerateHomepagePortalURL(PORTAL.portalname, NODE.nodename, Tabname) 

Description

Use the GenerateHomepagePortalURL function to create a URL string that represents an absolute reference the specified homepage tab on the portal servlet.

The PortalURI of the node that hosts the specified portal is used in the generated URL. The generated URL contains a reference to the portal service (psp) servlet.

If you want to generate a relative URL, use the GenerateHomepageRelativeURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

Note: The value specified for this parameter is ignored. The node name that is used is automatically calculated. However, you must still specify a value for this parameter.

nodename

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value. This should be the node that hosts the specified portal.

Tabname

Specify the name of the tab on the homepage that you want to generate a URL for. If you specify a null string (""), the default tab is used.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

http://Portal URI of host node/Portal/node/h/?tab=tabname

This function returns a Null string if you specify an invalid portal or node.

Example

Specifying the following code:

&HomePage = GenerateHomepagePortalURL(%Portal, NODE.North_Asia, "");

Might generate the following string:

http://bejing/psp/psoft/crm/North_Asia/h/?tab=DEFAULT

Syntax

GenerateHomepageRelativeURL(PORTAL.portalname, NODE.nodename, Tabname) 

Description

Use the GenerateHomepageRelativeURL function to create a URL string that represents a relative reference the specified homepage on the portal servlet. The relative reference is suitable for use on any page that itself has the simple URL format.

If you want to generate an absolute URL, use the GenerateHomepagePortalURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value. . This should be the node that hosts the specified portal.

Tabname

Specify the name of the tab on the homepage that you want to generate a URL for. If you specify a null string (""), the default tab is used.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

../../../Portal/node/h/?tab=tabname

If the node has a Node Type of ICType, a string of the following format is returned:

./?cmd=start

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&HomePage = GenerateHomepageRelativeURL(%Portal, NODE.North_Asia, "");

Might generate the following string:

../../../crm/North_Asia/h/?tab=DEFAULT

Syntax

GenerateQueryContentURL(Portal.portalname, Node.nodename, QueryName, IsPublic [, IsNewWindow])

Description

Use the GenerateQueryContentURL function to create a URL string that represents an absolute reference to the specified query (URL) on the content servlet.

The PortalURI of the node that hosts the specified portal is used in the generated URL. The generated URL contains a reference to the portal content (psc) servlet.

If you want to generate a relative URL, use the GenerateQueryRelativeURL function.

If you want to generate a URL for the portal service (psp) servlet, use the GenerateQueryPortalURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word Portal. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the query, prefixed with the reserved word Node. You can also use a string, such as %Node, for this value.

Queryname

Specify the name of the query you want to generate a URL for. This parameter takes a string value.

IsPublic

Specify whether the query is public or private. This parameter takes a Boolean value: True, the query is public, False otherwise.

IsNewWindow

Specify whether the URL is for a new browser instance. This parameter takes a Boolean value: True, the URL is for a new browser instance, False otherwise. The default is False.

If the value is True this function generates a new state block for use in a separate browser instance. This does not automatically open a new browser instance. It just supports it.

Note: When Query is being run on a PeopleTools version prior to 8.16, the query URL does not include the ability to specify if a query is public or private. On PeopleTools versions 8.16 and higher, the generated URL contains either the keyword PUBLIC or PRIVATE prepended to the query name. If you are building a URL for a portal node that is on a PeopleTools release prior to 8.16, you must remove the public or private keyword before trying to use the URL.

Returns

If IsPublic is specified as True, and the node has a Node Type of PIA, a string of the following format is returned:

http://PortalURI/Portal/node/q/?ICAction=ICQryNameURL=PUBLIC.QueryName

If IsPublic is specified as False, and the node has a Node Type of PIA, a string of the following format is returned:

http://PortalURI/Portal/node/q/?ICAction=ICQryNameURL=PRIVATE.QueryName

This function returns a Null string if you specify an invalid portal or node.

Example

The following code example:

&url = GenerateQueryContentURL(%Portal, "RMTNODE", "QUERYNAME", True);

might produce a string as follows:

http://bsto091200/psc/ps/EMPLOYEE/RMTNODE/q/?ICAction=ICQryNameURL=PUBLIC.QUERYNAME

The following code example uses the optional parameter to produce a URL that supports a new browser instance:

&url = GenerateQueryContentURL(%Portal, "RMTNODE", "QUERYNAME", True, True);

might produce a string as follows:

http://bsto091200/psc/ps_newwin/EMPLOYEE/RMTNODE/q/?ICAction=ICQryNameURL=
PUBLIC.QUERYNAME

Syntax

GenerateQueryPortalURL(Portal.portalname, Node.nodename, QueryName, IsPublic [, IsNewWindow])

Description

Use the GenerateQueryPortalURL function to create a URL string that represents an absolute reference to the specified query (URL) on the portal servlet.

The PortalURI of the node that hosts the specified portal is used in the generated URL. The generated URL contains a reference to the portal service (psp) servlet.

If you want to generate a relative URL, use the GenerateQueryRelativeURL function.

If you want to generate a URL for the portal content (psc) servlet, use the GenerateQueryContentURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word Portal. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the query, prefixed with the reserved word Node. You can also use a string, such as %Node, for this value.

Queryname

Specify the name of the query you want to generate a URL for. This parameter takes a string value.

IsPublic

Specify whether the query is public or private. This parameter takes a Boolean value: True, the query is public, False otherwise.

IsNewWindow

Specify whether the URL is for a new browser instance. This parameter takes a Boolean value: True, the URL is for a new browser instance, False otherwise. The default is False.

If the value is True this function generates a new state block for use in a separate browser instance. This does not automatically open a new browser instance. It just supports it.

Note: When Query is being run on a PeopleTools version prior to 8.16, the query URL does not include the ability to specify if a query is public or private. On PeopleTools versions 8.16 and higher, the generated URL contains either the keyword PUBLIC or PRIVATE prepended to the query name. If you are building a URL for a portal node that is on a PeopleTools release prior to 8.16, you must remove the public or private keyword before trying to use the URL.

Returns

If IsPublic is specified as True, and the node has a Node Type of PIA, a string of the following format is returned:

http://PortalURI/Portal/node/q/?ICAction=ICQryNameURL=PUBLIC.QueryName

If IsPublic is specified as False, and the node has a Node Type of PIA, a string of the following format is returned:

http://PortalURI/Portal/node/q/?ICAction=ICQryNameURL=PRIVATE.QueryName

This function returns a Null string if you specify an invalid portal or node.

Example

The following code example:

&url = GenerateQueryPortalURL(%Portal, "RMTNODE", "QUERYNAME", True);

might produce a string as follows:

http://bsto091200/psp/ps/EMPLOYEE/RMTNODE/q/?ICAction=ICQryNameURL=PUBLIC.QUERYNAME

The following code example uses the optional parameter to produce a URL that supports a new browser instance:

&url = GenerateQueryPortalURL(%Portal, "RMTNODE", "QUERYNAME", True, True);

might produce a string as follows:

http://bsto091200/psp/ps_newwin/EMPLOYEE/RMTNODE/q/?ICAction=ICQryNameURL=
PUBLIC.QUERYNAME

Syntax

GenerateQueryRelativeURL(Portal.portalname, Node.nodename, QueryName, IsPublic [, IsNewWindow])

Description

Use the GenerateQueryRelativeURL function to creates a URL string that represents a relative reference to the specified query on the portal servlet. The relative reference is suitable for use on any page that itself has the simple URL format.

If you want to generate an absolute URL, use either the GenerateQueryPortalURL or GenerateQueryContentURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word Portal. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the query, prefixed with the reserved word Node. You can also use a string, such as %Node, for this value.

Queryname

Specify the name of the query you want to generate a URL for. This parameter takes a string value.

IsPublic

Specify whether the query is public or private. This parameter takes a Boolean value: True, the query is public, False otherwise.

IsNewWindow

Specify whether the URL is for a new browser instance. This parameter takes a Boolean value: True, the URL is for a new browser instance, False otherwise. The default is False.

If the value is True this function generates a new state block for use in a separate browser instance. This does not automatically open a new browser instance. It just supports it.

Note: When Query is being run on a PeopleTools version prior to 8.16, the query URL does not include the ability to specify if a query is public or private. On PeopleTools versions 8.16 and higher, the generated URL contains either the keyword PUBLIC or PRIVATE prepended to the query name. If you are building a URL for a portal node that is on a PeopleTools release prior to 8.16, you must remove the public or private keyword before trying to use the URL.

Returns

If IsPublic is specified as True, and the node has a Node Type of PIA, a string of the following format is returned:

../../../portal/node/q/?ICAction=ICQryNameURL=PUBLIC.QueryName

If IsPublic is specified as False, and the node has a Node Type of PIA, a string of the following format is returned:

../../../portal/node/q/q/?ICAction=ICQryNameURL=PRIVATE.QueryName

This function returns a Null string if you specify an invalid portal or node.

Example

The following code example:

&url = GenerateQueryRelativeURL(%Portal, "RMTNODE", "QUERYNAME", True);

might produce a string as follows:

../../../EMPLOYEE/RMTNODE/q/?ICAction=ICQryNameURL=PUBLIC.QUERYNAME

Syntax

GenerateScriptContentRelURL(PORTAL.portalname, NODE.nodename, RECORD.recordname, FIELD.fieldname, event_name, function_name, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2].
. .

OR

&RecordObject1 [, &RecordObject2].  .  .

Description

Use the GenerateScriptContentRelURL function to create a URL string that represents a relative reference to the specified iScript. The generated URL contains a reference to the portal content (psc) servlet.

If you want to generate an absolute URL for an iScript for the portal content servlet, use the GenerateScriptContentURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the iScript, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

recordname

Specify the name of the record containing the iScript, prefixed with the reserved word RECORD.

fieldname

Specify the name of the field containing the iScript, prefixed with the reserved word FIELD.

event_name

Specify the name of the event containing the iScript. This is generally the FieldFormula event.

function_name

Specify the name of the iScript function.

keylist

An optional list of parameters used with the function. It can also be an already instantiated record object.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

/psc/s/recname.fieldname.event_name.function_name?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

/portal/node/?ICType=Script&ICScriptProgramName=recname.fieldname.event_name.function_name?parameters

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&MyScriptURL = GenerateScriptContentRelURL("EMPLOYEEPORTAL", "CRM", Record.WEBLIB_
CRM, Field.SFASCRIPTS, "FieldFormula", "Iscript_SFAHOME "); 

Might yield the following URL:

/psc/s/WEBLIB_CRM.SFASCRIPTS.FieldFormula.IScript_SFAHOME

Syntax

GenerateScriptContentURL(PORTAL.portalname, NODE.nodename, RECORD.recordname, FIELD.fieldname, event_name, function_name, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2].
. .

OR

&RecordObject1 [, &RecordObject2].  .  .

Description

Use the GenerateScriptContentURL function to create a URL string that represents an absolute reference to the specified iScript for the content servlet.

The ContentURI of the specified node is used in the generated URL. The URL contains a reference to the portal content (psc) servlet.

If you want to generate a URL for an iScript for the portal servlet, use the GenerateScriptPortalURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the iScript, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

recordname

Specify the name of the record containing the iScript, prefixed with the reserved word RECORD.

fieldname

Specify the name of the field containing the iScript, prefixed with the reserved word FIELD.

event_name

Specify the name of the event containing the iScript. This is generally the FieldFormula event.

function_name

Specify the name of the iScript function.

keylist

An optional list of parameters used with the function. It can also be an already instantiated record object.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

http://Content URI of host node/portal/node/s/recname.fieldname.event_
name.function_name?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

http://Content URI of host node/portal/node/?ICType=Script&ICScriptProgramName=recname.fieldname.event_name.function_name?parameters

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&MyScriptURL = GenerateScriptContentURL("EMPLOYEEPORTAL", "CRM", Record.WEBLIB_
CRM, Field.SFASCRIPTS, "FieldFormula", "Iscript_SFAHOME "); 

Might yield the following URL:

http://mike.com/servlets/psc/testsite/EMPLOYEEPORTAL/CRM/s/WEBLIB_
CRM.SFASCRIPTS.FieldFormula.IScript_SFAHOME

Syntax

GenerateScriptPortalRelURL(PORTAL.portalname, NODE.nodename, RECORD.recordname, FIELD.fieldname, event_name, function_name, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2].
. .

OR

&RecordObject1 [, &RecordObject2].  .  .

Description

Use the GenerateScriptPortalRelURL function to create a URL string that represents a relative reference to the specified iScript. The generated URL contains a reference to the portal service (psp) servlet.

If you want to generate an absolute URL for an iScript for the portal service servlet, use the GenerateScriptPortalURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the iScript, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

recordname

Specify the name of the record containing the iScript, prefixed with the reserved word RECORD.

fieldname

Specify the name of the field containing the iScript, prefixed with the reserved word FIELD.

event_name

Specify the name of the event containing the iScript. This is generally the FieldFormula event.

function_name

Specify the name of the iScript function.

keylist

An optional list of parameters used with the function. It can also be an already instantiated record object.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

/psp/s/recname.fieldname.event_name.function_name?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

/portal/node/?ICType=Script&ICScriptProgramName=recname.fieldname.event_name.function_name?parameters

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&MyScriptURL = GenerateScriptPortalRelURL("EMPLOYEEPORTAL", "CRM", Record.WEBLIB_
CRM, Field.SFASCRIPTS, "FieldFormula", "IScript_SFAHOME"); 

Might yield the following:

/psp/s/WEBLIB_CRM.SFASCRIPTS.FieldFormula.IScript_SFAHOME

Syntax

GenerateScriptPortalURL(PORTAL.portalname, NODE.nodename, RECORD.recordname, FIELD.fieldname, event_name, function_name, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2].
. .

OR

&RecordObject1 [, &RecordObject2].  .  .

Description

Use the GenerateScriptPortalURL function to create a URL string that represents an absolute reference to the specified iScript for the portal servlet. The PortalURI of the node that hosts the specified portal is used in the generated URL. The URL contains a reference to the portal service (psp) servlet.

If you want to generate a URL for an iScript for the portal content (psc) servlet, use the GenerateScriptContentURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the iScript, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

recordname

Specify the name of the record containing the iScript, prefixed with the reserved word RECORD.

fieldname

Specify the name of the field containing the iScript, prefixed with the reserved word FIELD.

event_name

Specify the name of the event containing the iScript. This is generally the FieldFormula event.

function_name

Specify the name of the iScript function.

keylist

An optional list of parameters used with the function. It can also be an already instantiated record object.

Returns

If a node has a Node Type of PIA, a string of the following format is returned:

http://Portal URI of host portal/portal/node/s/recname.fieldname.event_
name.function_name?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

http://Portal URI of host node/portal/node/?ICType=Script&ICScriptProgramName=
recname.fieldname.event_name.function_name?parameters

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&MyScriptURL = GenerateScriptPortalURL("EMPLOYEEPORTAL", "CRM", Record.WEBLIB_CRM,
 Field.SFASCRIPTS, "FieldFormula", "IScript_SFAHOME"); 

Might yield the following:

http://mike.com/servlets/psp/testsite/EMPLOYEEPORTAL/CRM/s/WEBLIB_
CRM.SFASCRIPTS.FieldFormula.IScript_SFAHOME

Syntax

GenerateScriptRelativeURL(PORTAL.portalname, NODE.nodename, RECORD.recordname, FIELD.fieldname, event_name, function_name, [, keylist])

where keylist is a list of field references in the form:

[recordname.]field1 [, [recordname.]field2] ...

OR

&RecordObject1 [, &RecordObject2] ...

Description

Use the GenerateScriptRelativeURL function to create a relative URL string that represents a relative reference to the specified iScript. The relative reference is suitable for use on any page that has the simple URL format.

If you want to generate an absolute URL for an iScript, use either the GenerateScriptContentURL or GenerateScriptPortalURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the iScript, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

recordname

Specify the name of the record containing the iScript, prefixed with the reserved word RECORD.

fieldname

Specify the name of the field containing the iScript, prefixed with the reserved word FIELD.

event_name

Specify the name of the event containing the iScript. This is generally the FieldFormula event.

function_name

Specify the name of the iScript function.

keylist

An optional list of parameters used with the function. It can also be an already instantiated record object.

Returns

If the node has a Node Type of PIA, a string of the following format is returned:

../../../portal/node/s/recname.fieldname.event_name.function_name?parameters

If the node has a Node Type of ICType, a string of the following format is returned:

../../../portal/node/?ICType=Script&ICScriptProgramName=recname.fieldname.event_name.function_name?parameters

The question mark and the text following the question mark may or may not be included, depending on whether or not you specified a page and action or not.

This function returns a Null string if you specify an invalid portal or node.

Example

The following code:

&MyScriptURL = GenerateScriptRelativeURL("EMPLOYEE", "CRM", Record.WEBLIB_CRM, Field.SFASCRIPTS, "FieldFormula", "IScript_SFAHOME"); 

Might yield the following:

../../../EMPLOYEE/CRM/s/WEBLIB_CRM.SFASCRIPTS.FieldFormula.IScript_SFAHOME

Syntax

GenerateTree(&rowset [, TreeEventField])

Description

Use the GenerateTree function to display data in a tree format, with nodes and leaves. The result of the GenerateTree function is an HTML string, which can be displayed in an HTML area control. The tree generated by GenerateTree is called an HTML tree.

The GenerateTree function can be used in conjunction with the Tree Classes to display data from trees created using Tree Manager.

The GenerateTree function works with both an HTML area control and a hidden field. The TreeEventField parameter contains the contents of the invisible character field used to process the HTML tree events.

When an end user selects a node, expands a node, collapses a node, or uses one of the navigation links, that event (end-user action) is passed to the invisible field, and the invisible field's FieldChange PeopleCode is executed.

Parameters

Field or Control

Definition

&rowset

Specify the name of the rowset you've populated with tree data.

TreeEventField

Specify the contents of the invisible character field used to process the HTML tree events. The first time the GenerateTree function is used, that is, to generate the initial tree, you do not need to include this parameter. Subsequent calls require this parameter.

Returns

A string that contains HTML code that can be used with the HTML control to display a tree.

Example

In the following example, TREECTLEVENT is the name of the invisible control field that contains the event string that was passed from the browser.

HTMLAREA = GenerateTree(&TREECTL, TREECTLEVENT);

Syntax

GenerateWorklistPortalURL(PORTAL.portalname, NODE.nodename, BusProc, Activity, Event, Worklist, Instance) 

Description

Use the GenerateWorklistPortalURL function to create a URL string that represents an absolute reference the specified Worklist (URL) on the portal servlet.

The PortalURI of the node that hosts the specified portal is used in the generated URL. The generated URL contains a reference to the portal service (psp) servlet.

If you want to generate a relative URL, use the GenerateWorklistRelativeURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

BusProc

Specify the business process of the Worklist.

Activity

Specify the activity of the Worklist.

Event

Specify the event of the Worklist.

Instance

Specify the instance of the Worklist.

Returns

A string of the following format:

http://PortalURI/Portal/node/w/BusProc.Activity.Event.Worklist.Instance

This function returns a Null string if you specify an invalid portal or node.

Syntax

GenerateWorklistRelativeURL(PORTAL.portalname, NODE.nodename, BusProc, Activity, Event, Worklist, Instance) 

Description

Use the GenerateWorklistRelativeURL function to create a URL string that represents a relative reference to the specified Worklist on the portal servlet. The relative reference is suitable for use on any page that itself has the simple URL format.

If you want to generate an absolute URL, use the GenerateWorklistPortalURL function.

Parameters

Field or Control

Definition

portalname

Specify the name of the portal used for this request, prefixed with the reserved word PORTAL. You can also use a string, such as %Portal, for this value.

nodename

Specify the name of the node that contains the content, prefixed with the reserved word NODE. You can also use a string, such as %Node, for this value.

BusProc

Specify the business process of the Worklist.

Activity

Specify the activity of the Worklist.

Event

Specify the event of the Worklist.

Instance

Specify the instance of the Worklist.

Returns

A string of the following format:

../../../Portal/Node/w/BusProc.Activity.Event.Worklist.Instance

This function returns a Null string if you specify an invalid portal or node.

Example

The following is an example PeopleCode statement used to generate a URL for a worklist activity:

GenerateWorklistRelativeURL(%Portal, %Node, "Administer Workflow", "Find Timeout Worklists", "Worklist Current Operator", "Timeout Notification", 1);

Syntax

GenHTMLMenu(list[, fldr_img_class_ID] [, element_label])

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to generate an HTML code fragment that will be rendered in the browser as menu drop-downs, fly-outs, and breadcrumbs. Typically, this function is used when the SmartNavigation data source is a tree. The <li> elements in the input string are created by the GenRelatedActions function, the GenABNMenuElement method of the Node class, and the GenABNMenuElement method of the Leaf class.

Parameters

Field or Control

Definition

list

Specifies the list of <li> elements as a string.

fldr_img_class_ID

Specifies the class ID for a custom folder icon as a string. This class must be defined in a style sheet, and the style sheet must be assigned to the SmartNavigation folder.

This is an optional parameter. To use the default folder icon, you can omit this parameter or specify the null string "". However, to ensure forward compatibility or to use the default folder icon while specifying the element_label parameter, you must specify the null string.

element_label

Specifies a label for a drop-down menu item as an array with two numeric elements, which represents a message catalog entry. The first element is the message set number and the second element is the message number.

This label is applied to a drop-down menu item that is generated for the SmartNavigation breadcrumb on which the user has clicked, allowing the user to view the chart associated with that breadcrumb. The complete label is the word “View” with the element_label message appended.

This is an optional parameter.

If the element_label is not provided or if the message set or number is undefined, then a default message catalog entry (95, 9109) is used, which includes the default message, “User Profile Page,” in the label for the drop-down menu item.

Returns

None.

Syntax

GenToken()

Description

Use the GenToken function to create an authentication token for the user currently logged in, as a string.

Generally this function is used in an application engine program when an authentication token is not automatically generated. However, it can be used anytime. The token that is generated is usually passed to another process that has no token.

Parameters

None.

Returns

A string containing the authentication token.

Syntax

GetABNChartRowSet()

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to return a reference to a rowset representing the SmartNavigation chart for the rowset or tree data currently in the component buffer. This function flushes the rowset prior to returning. The SmartNavigation chart rowset comprises two record definitions: and PT_ABNCHARTNODE and PT_ABN_CHART_ND.

Parameters

None.

Returns

A SmartNavigation chart rowset. If the user clicks on a menu folder description instead, then this function returns Null.

Example

&chart_RS = GetABNChartRowSet();

Syntax

GetABNInitialNode(&reqParams)

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to return the identifier of the initial SmartNavigation chart node as a string.

Parameters

Field or Control

Definition

&reqParams

Specifies the array of request parameters (name-value pairs) generated by the GetABNReqParameters function. This is an array of array of string.

Returns

The identifier of the initial chart node as a string.

Syntax

GetABNNode(&reqParams)

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to return the identifier of the current SmartNavigation chart node as a string. The user requests this chart node through a mouse-click event

Parameters

Field or Control

Definition

&reqParams

Specifies the array of request parameters (name-value pairs) generated by the GetABNReqParameters function. This is an array of array of string.

Returns

The identifier of the current SmartNavigation chart node as a string.

Syntax

GetABNRelActnRowSet()

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to return a reference to the related actions rowset for the SmartNavigation chart. This function flushes the rowset prior to returning.

Parameters

None.

Returns

A related actions rowset. If the user clicks on the menu folder description instead, then this function returns Null.

Syntax

GetABNReqParameters([start])

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to generate HTTP request parameters as an array of name-value pairs. The start parameter specifies the initial node of the data source. When using a tree data source, the start parameter is optional. If the initial node is not provided, the tree's root node is the initial node.

When using a rowset data source, the start parameter is required. The returned request parameter array contains the following values:

Array Element

HTTP Request Parameter Name/Value

[1][1]

[1][2]

TREE_NAME

The tree's name.*

[2][1]

[2][2]

TREE_SETID

The tree's setID key.*

[3][1]

[3][2]

TREE_USERKEY

The tree's user key.*

[4][1]

[4][2]

TREE_EFFDT

The tree's effective date key.*

[5][1]

[5][2]

TREE_NODE

The name of the currently requested tree node.*

[6][1]

[6][2]

INITIAL_TREE_NODE

The name of the initial node.

* Set to an empty string when the data source is a rowset.

Parameters

Field or Control

Definition

start

Specifies a string representing the initial node of the tree or rowset data source.

Returns

An array of array of string representing the HTTP request parameters (name-value pairs).

Syntax

GetABNTreeEffdt(&reqParams)

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to extract the effective date key for the tree from the request parameter array. The output of this function is used to open the specified tree.

Parameters

Field or Control

Definition

&reqParams

Specifies the array of request parameters (name-value pairs) generated by the GetABNReqParameters function. This is an array of array of string.

Returns

A string representing the effective date key for the tree.

Note: If the SmartNavigation chart data source is a rowset, this function returns an empty string.

Syntax

GetABNTreeName(&reqParams)

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to extract the tree name from the request parameter array. The output of this function is used to open the specified tree.

Parameters

Field or Control

Definition

&reqParams

Specifies the array of request parameters (name-value pairs) generated by the GetABNReqParameters function. This is an array of array of string.

Returns

A string representing the tree name.

Note: If the SmartNavigation chart data source is a rowset, this function returns an empty string.

Syntax

GetABNTreeSetid(&reqParams)

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to extract the setID key for the tree from the request parameter array. The output of this function is used to open the specified tree.

Parameters

Field or Control

Definition

&reqParams

Specifies the array of request parameters (name-value pairs) generated by the GetABNReqParameters function. This is an array of array of string.

Returns

A string representing the setID key for the tree.

Note: If the SmartNavigation chart data source is a rowset, this function returns an empty string.

Syntax

GetABNTreeUserKey(&reqParams)

Description

Note: SmartNavigation has been deprecated. This function remains for backward compatibility only.

Use this function to extract the user key for the tree from the request parameter array. The output of this function is used to open the specified tree.

Parameters

Field or Control

Definition

&reqParams

Specifies the array of request parameters (name-value pairs) generated by the GetABNReqParameters function. This is an array of array of string.

Returns

A string representing the user key for the tree.

Note: If the SmartNavigation chart data source is a rowset, this function returns an empty string.

Syntax

GetAddSearchRecName()

Description

Use the GetAddSearchRecName function to return the add search record name for the component.

Important! Use this function within fluid applications only.

Parameters

None.

Returns

A string value.

Example

&strRecName = GetAddSearchRecordName();

Syntax

GetAESection(ae_applid, ae_section [, effdt])

Description

Use the GetAESection function to open and associate an AESection PeopleCode object with the base section, as specified. If no base section by the specified name is found, one is created. This enables you to create base sections as needed.

Warning! When you open or get an AESection object, (that is, the base section) any existing steps in the section are deleted.

After you’ve instantiated the AESection object, set the template section using the SetTemplate AESection class method. You can copy steps from the template section to the base section before you start the Application Engine program. This is useful for applications that let users input their "rules" into a user-friendly page, then convert these rules, at save time, into Application Engine constructs.

When an AESection is opened (or accessed), the system first looks to see if it exists with the given input parameters. If such a section doesn’t exist, the system looks for a similar section based on market, database platform, and effective date.

The AESection Object is designed for use within an online program. Typically, dynamic sections should be constructed in response to an end-user action.

Note: Do not call an AESection object from an Application Engine PeopleCode Action. If you need to access another section, use the CallSection action instead.

Parameters

Field or Control

Definition

ae_applid

Specifies the application ID of the section you want to modify.

ae_section

Specifies the section name of the base section you want to modify. If no base section by the specified name is found, one is created.

effdt

Specifies the effective date of the section you want to modify (optional).

Returns

An AESection object is returned.

Syntax

GetAnalyticGrid(Page.page_name, grid_name)

Description

Use the GetAnalyticGrid function to instantiate an analytic grid object from the AnalyticGrid class, and populates it with the grid specified by grid_name, which is the Page Field Name on the General tab of that analytic grid’s page field properties.

Note: PeopleSoft builds a page grid one row at a time. Because the AnalyticGrid class applies to a complete grid, you can’t attach PeopleCode that uses the AnalyticGrid class to events that occur before the grid is built; the earliest event you can use is the page Activate event.

See Activate Event.

Specifying the Grid Name

When you place an analytic grid on a page, the grid is automatically named the same as the name of the primary record of the scroll for the grid (from the Page Field Name field). This is the name you use with the GetAnalyticGrid function.

Note: If the name of the record changes, the Page Field Name is not automatically updated. You must change this name if you want the name of the grid to reflect the name of the record.

To change a grid name:

  1. Open the page definition in PeopleSoft Application Designer.

  2. Select the analytic grid and access the Analytic Grid control properties.

  3. On the General tab, type the new grid name in the Page Field Name field.

Note: Every grid on a page must have a unique name.

Parameters

Field or Control

Definition

Page.page_name

Specify the name of the page definition containing the grid you want to access.

Specify a grid name consisting of any combination of uppercase letters, digits and "#", "$", "@", and "_".

grid_name

Specify the Page Field Name on the General tab of the grid’s page field properties.

Returns

A reference to an AnalyticGrid object.

Syntax

GetAnalyticInstance(ID)

Description

Use the GetAnalyticInstance function to return a reference to the AnalyticInstance object as specified by the ID.

The analytic instance specified by ID must already be created before using this function.

Parameters

Field or Control

Definition

ID

Specify the analytic instance identifier that you want to access.

Returns

An AnalyticInstance object if successful, null otherwise.

Syntax

GetArchPubHeaderXmlDoc(PubID, PubNode, ChannelName, VersionName[, Segment])

Description

Use the GetArchPubHeaderXMLDoc function to retrieve an archived message header from the message queue.

This function has been deprecated. You will receive an error if you use this function.

Syntax

GetArchPubXmlDoc(PubID, PubNode, ChannelName, VersionName, MessageName, SubNode[, Segment])

Description

Use the GetArchPubXmlDoc function to retrieve an archived message from the message queue.

This function has been deprecated. You will receive an error if you use this function.

Syntax

GetArchSubXmlDoc(PubID, PubNode, ChannelName, VersionName, MessageName[, Segment])

Description

Use the GetArchSubXmlDoc function to retrieve an archived message from the message queue.

This function has been deprecated. You will receive an error if you use this function.

Syntax

GetAttachment(URLSource, DirAndSysFileName, DirAndLocalFileName[, LocalDirEnvVar[, PreserveCase]])

Description

Use the GetAttachment function to download a file from its source storage location to the file system of the application server. The file system of the application server includes any directories accessible from the application server including those on local disks as well as on network shares.

Note: All directories that are part of the destination full path name must exist before GetAttachment is called. The GetAttachment function will not create any directories on the application server's file system.

Additional information that is important to the use of GetAttachment can be found in the PeopleTools: PeopleCode Developer's Guide:

File System Considerations

If you are uncertain which type of file system the file is going to be transferred to, either a UNIX or Windows system, you should simply specify a file name for the DirAndLocalFileName parameter and either explicitly set the LocalDirEnvVar parameter or accept its default value, which is “TMP” (indicating that the value of the TMP environment variable will be used).

The following code example works for Windows systems, but not UNIX systems:

&retcode = GetAttachment(&FTPINFO, &SOURCEFILENAME, "c:\temp\resume.doc");

The following code example works for Unix systems, but not Windows systems:

&retcode = GetAttachment(&FTPINFO, &SOURCEFILENAME, "/tmp/resume.doc");

The following two examples work for both Windows and Unix systems:

&retcode = GetAttachment(&FTPINFO, &SOURCEFILENAME, "resume.doc"); 

&retcode = GetAttachment(&FTPINFO, &SOURCEFILENAME, "resume.doc", "PS_CFG_HOME");

Warning! If the effectively specified target directory that is to ultimately contain the downloaded file on the application server is a UNC (Universal Naming Convention) share, an error will occur and GetAttachment will fail to download the file.

You cannot use a share as the target directory—that is, as the ultimate destination—to download a file onto an application server using GetAttachment. However, you can use a subdirectory of a UNC share as the target directory.

For example, if a directory similar to the following were the target directory, GetAttachment would fail:

\\server_name\share_name

However, the following subdirectory of the same UNC share could be used with GetAttachment:

\\server_name\share_name\temp

Parameters

Field or Control

Definition

URLSource

A reference to a URL. This can be either a URL identifier the form URL.URL_ID, or a string. This (along with the DirAndSysFileName parameter) indicates the file's source location.

Note: When the URLSource parameter is specified as a string value, forward slashes (/) are required. Backward slashes (\) are not supported for a string value.

See Understanding URL Strings Versus URL Objects.

DirAndSysFileName

The relative path and file name of the file at the storage location. This is appended to URLSource to form the full URL where the file will be transferred from. This parameter takes a string value.

Note: Because the DirAndSysFileName parameter is appended to the URL, it also requires forward slashes (“/”). Backward slashes (“\”) are not supported for this parameter.

DirAndLocalFileName

The name, relative path name, or full path name of the destination file on the application server. This parameter takes a string value. If you specify only a name or a relative path name for the destination file, the file will be placed in or relative to:

  • The directory indicated by the value of the environment variable specified by the LocalDirEnvVar parameter.

  • The directory indicated by the value of the TMP environment variable if the LocalDirEnvVar parameter has not been specified.

If you do not want to use the LocalDirEnvVar parameter or the value of the TMP environment variable in this way, you must specify a full path name as appropriate to the application server’s operating system.

LocalDirEnvVar

This optional parameter takes a string value.

If LocalDirEnvVar is specified, then its value will be prefixed to the value of the DirAndLocalFileName parameter to form the full path name of the destination file on the application server’s file system. With this parameter, you can avoid the need to hard-code the full path name.

If LocalDirEnvVar is not specified and the value of the DirAndLocalFileName parameter is already a full path file name, then that value will itself be used as the full path name that the downloaded file will have at its destination on the application server machine. If LocalDirEnvVar is not specified and the value of the DirAndLocalFileName parameter is not a full path file name, then the value of the TMP environment variable will be prefixed to the value of the DirAndLocalFileName parameter to form the full path name that the downloaded file will have at its destination on the application server machine.

Note: In order to use the optional parameter PreserveCase, you must pass some value for LocalDirEnvVar. If you want to use the default behavior of LocalDirEnvVar and also use PreserveCase, you can specify "" (the empty string) for LocalDirEnvVar. Then the function behaves as if no value is specified. In this situation, if you wish to use the TMP environment variable, it must be explicitly specified.

Note: Do not specify LocalDirEnvVar if you use an absolute path for the DirAndLocalFileName parameter.

PreserveCase

When searching for the file specified by the DirAndSysFileName parameter, PreserveCase specifies a Boolean value to indicate whether the case of its file name extension is preserved: True, preserve the case, False, convert the file name extension in DirAndSysFileName to all lowercase letters.

The default value is False.

For a particular file, use the same value for this parameter that was used when the file was originally uploaded.

Warning! If you use the PreserveCase parameter, it is important that you use it in a consistent manner with all the relevant file-processing functions or you may encounter unexpected file-not-found errors.

This is an optional parameter.

Returns

You can check for either an integer or a constant value:

Numeric Value

Constant Value

Description

0

%Attachment_Success

File was transferred successfully.

1

%Attachment_Failed

File transfer failed due to unspecified error.

The following are some possible situations where %Attachment_Failed could be returned:

  • Failed to initialize the process due to some internal error.

  • Failed due to unexpected/bad reply from server.

  • Failed to allocate memory due to some internal error.

  • Failed due to timeout.

  • Failed due to non-availability of space on FTP server.

  • Failed to close SSL connection.

  • Failed due to an unspecified error on the HTTP repository.

    If the HTTP repository resides on a PeopleSoft web server, then you can configure tracing on the web server to report additional error details.

    See Enabling Tracing on the Web Server or Application Server.

3

%Attachment_FileTransferFailed

File transfer failed due to unspecified error during FTP attempt.

The following are some possible situations where %Attachment_FileTransferFailed could be returned:

  • Failed due to mismatch in file sizes.

  • Failed to write to local file.

  • Failed to store the file on remote server.

  • Failed to read local file to be uploaded

  • No response from server.

  • Failed to overwrite the file on remote server.

4

%Attachment_NoDiskSpaceAppServ

No disk space on the application server.

7

%Attachment_DestSystNotFound

Cannot locate destination system for FTP.

  • Improper URL format.

  • Failed to connect to the server specified.

8

%Attachment_DestSysFailedLogin

Unable to login to destination system for FTP.

The following are some possible situations where %Attachment_DestSysFailedLogin could be returned:

  • Unsupported protocol specified.

  • Access denied to server.

  • Failed to connect using SSL Failed to verify the certificates.

  • Failed due to problem in certificates used.

  • Could not authenticate the peer certificate.

  • Failed to login with specified SSL level.

  • Remote server denied logon.

  • Problem reading SSL certificate.

9

%Attachment_FileNotFound

Cannot locate file.

The following are some possible situations where %Attachment_FileNotFound could be returned:

  • Remote file not found.

  • Failed to read remote file.

Example

The following downloads the file, HRarchive/NewHire/11042000resume.txt, from the FTP server to c:\NewHires\resume.txt on the application server machine.

&retcode = GetAttachment("ftp://anonymous:hobbit1@ftp.ps.com/HRarchive/", "NewHire/11042000resume.txt", "c:\NewHires\resume.txt");

Syntax

GetAttachmentURL(URLSource, DirAndSysFileName, UserFileName , AttachmentURL [, AuthToken][, ContentURI][, PreserveCase])

Description

Use the GetAttachmentURL function within a Mobile Application Platform (MAP) application to temporarily download a file from its source storage location and return the associated attachment URL. This attachment URL can subsequently be used by the MAP application to temporarily gain secure access to the downloaded file.

Additional information that is important to the use of GetAttachmentURL can be found in the PeopleTools: PeopleCode Developer's Guide:

Parameters

Field or Control

Definition

URLSource

Specifies a reference to a URL. This can be either a URL identifier in the form URL.URL_ID, or a string. This, along with the DirAndSysFileName parameter, indicates the file's source location.

Note: The URLSource parameter requires forward slashes (/). Backward slashes (\) are not supported for this parameter.

See Understanding URL Strings Versus URL Objects.

DirAndSysFileName

Specifies the relative path and file name of the file on the file server. This is appended to URLSource to make up the full URL where the file is transferred from. This parameter takes a string value

Note: The URLSource requires "/" slashes. Because DirAndSysFileName is appended to the URL, it also requires only "/" slashes. "\" are NOT supported in anyway for either the URLSource or the DirAndSysFileName parameter.

UserFileName

Specifies the name of the as it was known to the end-user at the time it was originally uploaded as a string value (may be different than the name of the file at the storage location).

AttachmentURL

Returns the attachment URL as a string value.

Specify AttachmenURL as a string variable or a field reference in the form of [RECORD.]FIELD. You must supply the RECORD only if the record field and your PeopleCode program are in different record definitions.

AuthToken

Specifies the PeopleSoft authentication token to be used to retrieve the file from the file storage location.

The default value for this optional parameter is the empty string.

Important! A MAP application must treat AuthToken as a required parameter.

ContentURI

Specifies the content URI to be used by this function to construct the returned attachment URL. This string value can be specified as:

  • A quoted reference to a PeopleSoft node object (in the form, Node.NODE_NAME) that has a content URI property with a value that will be used as the content URI. For example:

    "Node.PSFT_HR"
  • A quoted reference to a PeopleSoft URL object (in the form, URL.URL_ID) that has a URL property with a value that will be used as the content URI. For example:

    "URL.MY_URI_URL"
  • A literal string. For example:

    "http://example.com:8080/psc/ps/"

The default value of this optional parameter is the empty string.

Important! If no value is specified for this parameter or its value is explicitly specified as an empty string, then the value of the content URI property of the default local node is used.

PreserveCase

Specify a Boolean value to indicate whether when searching for the file specified by the DirAndSysFileName parameter, its file name extension is preserved or not; True, preserve the case of the file name extension, False, convert the file name extension to all lowercase letters.

The default value is False.

Warning! If you use the PreserveCase parameter, it is important that you use it in a consistent manner with all the relevant file-processing functions or you may encounter unexpected file-not-found errors.

Returns

You can check for either an integer or a constant value:

Numeric Value

Constant Value

Description

0

%Attachment_Success

File was transferred successfully.

Important! If file type restrictions are changed so that access to a previously uploaded file is now blocked, a call to ViewAttachment will return %Attachment_Success, even though the file and its contents are not displayed.

1

%Attachment_Failed

File transfer failed due to unspecified error.

The following are some possible situations where %Attachment_Failed could be returned:

  • Failed to initialize the process due to some internal error.

  • Failed due to unexpected/bad reply from server.

  • Failed to allocate memory due to some internal error.

  • Failed due to timeout.

  • Failed due to non-availability of space on FTP server.

  • Failed to close SSL connection.

  • Failed due to an unspecified error on the HTTP repository.

    If the HTTP repository resides on a PeopleSoft web server, then you can configure tracing on the web server to report additional error details.

    See Enabling Tracing on the Web Server or Application Server.

3

%Attachment_FileTransferFailed

File transfer failed due to unspecified error during FTP attempt.

The following are some possible situations where %Attachment_FileTransferFailed could be returned:

  • Failed due to mismatch in file sizes.

  • Failed to write to local file.

  • Failed to store the file on remote server.

  • Failed to read local file to be uploaded

  • No response from server.

  • Failed to overwrite the file on remote server.

7

%Attachment_DestSystNotFound

Cannot locate destination system for FTP.

The following are some possible situations where %Attachment_DestSystNotFound could be returned:

  • Improper URL format.

  • Failed to connect to the server specified.

8

%Attachment_DestSysFailedLogin

Unable to login to destination system for FTP.

The following are some possible situations where %Attachment_DestSysFailedLogin could be returned:

  • Unsupported protocol specified.

  • Access denied to server.

  • Failed to connect using SSL Failed to verify the certificates.

  • Failed due to problem in certificates used.

  • Could not authenticate the peer certificate.

  • Failed to login with specified SSL level.

  • Remote server denied logon.

  • Problem reading SSL certificate.

9

%Attachment_FileNotFound

Cannot locate file.

The following are some possible situations where %Attachment_FileNotFound could be returned:

  • Remote file not found.

  • Failed to read remote file.

Example

For example, a file called, "my_resume.doc", has previously been uploaded with a system file name of "21EC2020-3AEA-4069-A2DD-08002B30309D_my_resume.doc" to the database table associated with the PSFILE_ATTDET record, and the content URI property of the default local node has been explicitly set to the appropriate content URI value. The GetAttachmentURL invocation returns a URL giving temporary access to that file. The MAP application assigns the URL as the value of a primitive—for example, a URL element.

Local integer &RETCODE;
Local string &URL_ID;
Local string &ATTACHSYSFILENAME;
Local string &ATTACHUSERFILE;
Local string &ATTACHMENTURL;
Local string &AUTHTOKEN;
Local Document &Doc;
Local Compound &Com;

&URL_ID = "record://PSFILE_ATTDET";
&ATTACHSYSFILENAME = "21EC2020-3AEA-4069-A2DD-08002B30309D_my_resume.doc";
&ATTACHUSERFILE = "my_resume.doc";
&AUTHTOKEN = &Map.GetAuthToken();
&RETCODE = GetAttachmentURL(&URL_ID, &ATTACHSYSFILENAME, &ATTACHUSERFILE, &ATTACHMENTURL, &AUTHTOKEN);

&Doc = &Map.getDocument();
&Com = &Doc.DocumentElement;
&Com.GetPropertyByName("AttachURL").Value = &ATTACHMENTURL;
 

Syntax

GetBiDoc(XMLstring)

Description

Use the GetBiDoc function to create a BiDocs structure. You can populate the structure with data from XMLstring. This is part of the incoming Business Interlink functionality, which enables PeopleCode to receive an XML request and return an XML response.

Note: Business Interlinks is a deprecated product. Use PeopleSoft Integration Broker instead.

See PeopleTools: Integration Broker.

Parameters

Field or Control

Definition

XMLstring

A string containing XML. You can specify a NULL string for this parameter, that is, two quotation marks ("") without a space between them.

Return Value

A BiDocs object.

Example

The following example gets an XML request, puts it into a text string, and puts that into a BiDoc. After this is done, the GetDoc method and the GetValue method can get the value of the skills XML element, which is contained within the postreq XML element in the XML request.

Local BIDocs &rootInDoc, &postreqDoc; 
Local string &blob; 
Local number &ret; 
 
&blob = %Request.GetContentBody(); 
/* process the incoming xml(request)- Create a BiDoc and fill with the request*/ 
&rootInDoc = GetBiDoc(&blob); 
&postreqDoc = &rootInDoc.GetDoc("postreq"); 
&ret = &postreqDoc.GetValue("skills", &skills);

You can also create an empty BiDoc with GetBiDoc, as in the following example.

Local BIDocs &rootInDoc, &postreqDoc; 
Local string &blob; 
Local number &ret; 
 
&blob = %Request.GetContentBody(); 
/* process the incoming xml(request)- Create a BiDoc and fill with the request*/ 
&rootInDoc = GetBiDoc(""); 
&ret = &rootInDoc.ParseXMLString(&blob); 
&postreqDoc = &rootInDoc.GetDoc("postreq"); 
&ret = &postreqDoc.GetValue("skills", &skills);

Syntax

GetBreadcrumbs()

Description

Note: This function has been deprecated and is retained for backward compatibility only.

Use the GetBreadcrumbs function to return the user’s current history stack as an array of array of string in reverse order of access—that is, the first history record in the list represents the current content reference. The array of string includes 11 elements as specified in the following table. Specific values are included in the table when they do not vary based on the breadcrumb type; otherwise, blank cells indicate values that are dependent on the specific breadcrumb. For example, breadcrumbs created by PeopleTools do not include certain values such as a page ID or component keys. These and any other unknown values are returned as the literal string “UnknownValue”.

Data Element

Breadcrumb Generated by CreateBreadcrumb

Content Breadcrumb Generated by PeopleTools

Folder Breadcrumb Generated by PeopleTools

Element type

C

C

F

History record ID

Portal ID

Node ID

Component ID

UnknownValue

Page ID

UnknownValue

UnknownValue

Back label

Component mode

UnknownValue

UnknownValue

Component keys

UnknownValue

UnknownValue

Content URL

Query string parameters

UnknownValue

UnknownValue

The GetBreadcrumbs function returns a Null value in the following situations:

  • When the history stack is empty—for example, when the function is invoked by an action on a homepage pagelet or tile.

  • When the source content is not displayed in the PeopleSoft portal template—for example, if you display the content in your own portal or if the content is displayed via a direct psc URL.

  • When executing JavaScript fails to retrieve any history stack data.

Note: This function cannot be invoked from a fluid component. In addition, this function cannot be invoked after the content is displayed via a direct psc URL.

Parameters

None

Returns

A array of array of string.

Example

In the following example, the invocation of GetBreadcrumbs returns five history records. The first and second history records are application-specific records generated by calls to CreateBreadcrumb. The final three history records represent folder navigation generated automatically by PeopleTools:

[C,PT_ROLEMAINT_GBL_2,EMPLOYEE,QE_LOCAL,MAINTAIN_SECURITY.ROLEMAINT.GBL,ROLEDEFN,Role Maintenance,U,ROLENAME:'ADMINISTRATOR',http://.../MAINTAIN_SECURITY.ROLEMAINT.GBL,UnknownValue]
[C,PT_USERMAINT_GBL,EMPLOYEE,QE_LOCAL,MAINTAIN_SECURITY.USERMAINT.GBL,USER_ROLES,Role Maintenance,U,UnknownValue,http://.../MAINTAIN_SECURITY.USERMAINT.GBL,UnknownValue]
[F,PT_USER_PROFILES,EMPLOYEE,QE_LOCAL,UnknownValue,UnknownValue,User Profiles,UnknownValue,UnknownValue,http://.../WEBLIB_PT_NAV.ISCRIPT1.FieldFormula.IScript_PT_NAV_INFRAME,UnknownValue ]
[F,PT_SECURITY,EMPLOYEE,QE_LOCAL,UnknownValue,UnknownValue,Security,UnknownValue,UnknownValue,http://.../WEBLIB_PT_NAV.ISCRIPT1.FieldFormula.IScript_PT_NAV_INFRAME,UnknownValue]
[F,PT_PEOPLETOOLS,EMPLOYEE,QE_LOCAL,UnknownValue,UnknownValue,PeopleTools,UnknownValue,UnknownValue,http://.../WEBLIB_PT_NAV.ISCRIPT1.FieldFormula.IScript_PT_NAV_INFRAME,UnknownValue]

Syntax

GetCalendarDate(comparedate, periods, periodadjustment,outfieldname, company, paygroup)

Description

Use the GetCalendarDate function to return the value of a Date field from the PS_PAY_CALENDAR table. If a table entry is not found, GetCalendarDate returns 1899-01-01.

Processing Rules

The following are the processing rules for GetCalendarDate:

  1. The function SELECTs all the values for outfieldname, PAY_BEGIN_DT and PAY_END_DT from PS_PAY_CALENDAR. The result set is sorted in increasing PAY_END_DT order.

  2. A SQL SELECT statement is generated in the following form:

  3. SELECT outfieldname, PAY_BEGIN_DT, PAY_END_DT FROM PS_PAY_CALENDAR WHERE COMPAny=:1 AND PAYGROUP=:2 ORDER BY PAY_END_DT;

  4. Rows are fetched from the result set until the value of comparedate falls between PAY_BEGIN_DT and PAY_END_DT. The value of outfieldname is stored in a storage stack.

  5. A work variable equal to the value in periods is set.

  6. If the value of outfieldname in the located result row is equal to comparedate, then the value in periodadjustment is added to the work variable. Because periodadjustment may be negative, the result may be negative.

  7. If the work variable is negative then the saved value of outfieldname is returned from the storage stack at the level specified by the work variable. If the work variable is positive then fetch forward the number of times specified by the work variable. The value of outfieldname is returned from the most recently fetched (current) row.

Parameters

Field or Control

Definition

comparedate

A date field set by the caller as the date of interest, for example, "1997-02-17."

periods

A numeric variable set by the caller specifying the number of periods forward or backward to be returned.

periodadjustment

A numeric variable that adjusts the periods if the comparedate equals the period end date. This is typically used to adjust for period end dates. Usually the periodadjustment is either -1, 0, or 1.

outfieldname

The name of a date field in the PS_PAY_CALENDAR table. For example PAY_BEGIN_DT. The value of this field is not referenced or modified by the routine, but the name of the field is used to build a SQL SELECT statement and to indicate which value from the table to return in the return date.

company

A field set by the caller to be equal to the company code of interest, for example, "CCB".

paygroup

A variable set by the caller to be equal to the PayGroup code of interest, for example, "M01".

Returns

Returns a Date value from the PS_PAY_CALENDAR table.

Example

The following examples use the sample PS_PAY_CALENDAR entries in the following table. In the example, comparedate and the result date are Date type fields defined in some record.

COMPANY

PAYGROUP

PAY_END_DT

PAY_BEGIN_DT

CHECK_DT

CCB

MO1

1997-01-31

1997-01-01

1997-01-31

CCB

MO1

1997-02-28

1997-02-01

1997-02-28

CCB

MO1

1997-03-31

1997-03-01

1997-03-29

CCB

MO1

1997-04-30

1997-04-01

1997-04-30

CCB

MO1

1997-05-31

1997-05-01

1997-05-31

CCB

MO1

1997-06-30

1997-06-01

1997-06-28

CCB

MO1

1997-07-31

1997-07-01

1997-07-31

CCB

MO1

1997-08-31

1997-08-01

1997-08-30

CCB

MO1

1997-09-30

1997-09-01

1997-09-30

CCB

MO1

1997-10-31

1997-10-01

1997-10-31

CCB

MO1

1997-11-30

1997-11-01

1997-11-27

CCB

MO1

1997-12-31

1997-12-01

1997-12-31

CCB

SM1

1997-01-15

1997-01-01

1997-01-15

Find the begin date of the pay period containing the date 1997-05-11 (the value of &COMPAREDate). The result date returned would be 1997-05-01.

&RESULT_Date = GetCalendarDate(&COMPAREDate, 0, 0,
   PAY_BEGIN_DT, COMPAny, PAYGROUP);

Or:

&RESULT_Date = GetCalendarDate(&COMPAREDate, 1, -1,
   PAY_BEGIN_DT, COMPAny, PAYGROUP);

Syntax

GetChart(RecordName.FieldName)

Description

Use the GetChart function to get a reference to a Chart object.

A chart must be associated with a record and field merely so that the chart object can be instantiated in PeopleCode. Which record and field you use doesn't matter. Commonly, the same derived/work record is used for all the charts in an application.

Parameters

Field or Control

Definition

RecordName.FieldName

Specify the record and field name associated with the chart.

Returns

A reference to a Chart object.

Example

&MyChart = GetChart(CHARTREC_WRK.CHART_FLD);

Syntax

GetChartURL(&Chart)

Description

Use the GetChartURL function to generate the URL of a chart object. This URL can then be used in your application for displaying a chart.

GetChartURL can be used only with the Chart class and Gantt class.

Parameters

Field or Control

Definition

&Chart

Specify an already instantiated Chart object or Gantt object.

Returns

A URL as a string.

Example

Function IScript_GetChartURL() 
local object &MyChart; 
local string &MyURL; 
 
   &MyChart = CreateObject("Chart"); 
   &MyChart .SetData = xx;  
 
/* xx will be a data row set */ 
 
   &MyURL = %Response.GetChartURL(&MyChart); 
   &sMap = &oChart.ImageMap; 
    
   %Response.Write("<HTML><IMG SRC="); 
   %Response.Write(&MyURL); 
   %Response.Write("  USEMAP=#THEMAP></IMG><MAP NAME=THEMAP>"); 
   %Response.Write(&sMap); 
   %Response.Write("</MAP></HTML>"); 
 
End-Function;

Syntax

GetComponentTitle()

Description

Use the GetComponentTitle function to return the name of the component (from the component definition).

Important! Use this function within fluid applications only.

Parameters

None.

Returns

A String value.

Example

&sPageTitle = GetComponentTitle();

Syntax

GetCwd()

Description

Use the GetCwd function to determine the current working directory of the process that executes it. This means that in PeopleSoft Pure Internet Architecture it returns the current working directory on the server, in an Application Engine program it returns the current working directory of the Application Engine process, and so on.

Returns

Returns a string containing the path of the current working directory.

Example

The example stores a string specifying the current working directory in &CWD.

&CWD = GetCwd();

Syntax

GetDefinitionAccess(Definition_Type, Key_Collection)

Description

Use the GetDefinitionAccess function to return the access setting of a particular definition for a user.

Note: Definition type and definition security setting do not apply to runtime operations. You should consider using the GetDefinitionAccess function to determine the access settings of a definition only for PIA components that are considered design-time components.

Parameters

Field or Control

Definition

Definition_Type

Specifies the definition group for creating and modifying definitions as a string value.

Key_Collection

Determines the keys of the table that contains the Definition Type as a string value.

Valid definition types:

Definition Type

Description

ACTIVITYNAME

Activities

ANALYTIC_MODEL_ID

Analytic Models

PROBTYPE

Analytic Types

AEAPPLICATIONID

Application Engine Programs

APPLICATION_PACKAGE

Application Packages

APPRRULESET

Approval Rule Sets

INTERFACE_OBJECT

Business Interlinks

BUSINESSPROCESS

Business Processes

COMPONENTINTERFACE

Component Interfaces

COMPONENT

Components

FIELD_FORMAT

Field Formats

DBFIELD

Fields

FILELAYOUT

File Layouts

TYPECODE

File Type Codes

HTML

HTML

IMAGE

Images

MENU

Menus

CHANNEL

Message Channels

MESSAGE

Messages

MOBILEPAGE

Mobile Pages

OPTMODEL

Optimization Models

PAGE

Pages

PROJECT

Projects

QRYNAME

Queries

RECORD

Records

SQL

SQL

STYLESHEET

Style Sheets

STYLE

Styles

TRANSLATE

Translate Tables

TREE_STRCT_ID

Tree Structures

TREE_NAME

Trees

Returns

Integer.

Numeric Value

Description

0

Full access.

1

Display only access.

2

No access.

Example

&Access = GetDefinitionAccess("RECORD", "PSOPRDEFN");
If &Access = 0 Then
   WinMessage("You have Full Access", 0);
Else
   If &Access = 1 Then
      WinMessage("You have Display-Only Access", 0);
   Else
      WinMessage("You have No Access", 0);
   End-If;
End-If;

Description

Note: The GetDialGauge function is no longer used in PeopleTools 8.57 and will be ignored.

Syntax

GetEnv(env_var)

Description

Use the GetEnv function to return the value of an environment variable specified by env_var as a string. If the environment variable does not exist, GetEnv it returns a null string.

For example, you can use the GetEnv function to determine the actual path of PS_HOME. You could use this with the Exec function, which automatically prepends the command string with the path of PS_HOME.

Parameters

Field or Control

Definition

env_var

A string specifying the environment variable.

Important! Because the input string is converted to all uppercase, the env_var parameter is case-insensitive. While environment variable names are case-sensitive on UNIX systems—that is, "netdrive" is a different variable from "NetDrive"—in both cases, GetEnv returns the value of the NETDRIVE environment variable if it exists.

Returns

A string representing the value of the specified environment variable; Null if the variable does not exist.

Example

Assume that the environment variable NETDRIVE is equal to "N:" and the environment variable netdrive is equal to "P:”. The following statement returns "N:" in &drive:

&drive = GetEnv("netdrive");

Furthermore, if the environment variables netdrive and NetDrive are defined on a UNIX system, but not NETDRIVE, each of the following calls to GetEnv return Null:

&string = GetEnv("netdrive");
&string = GetEnv("NetDrive");
&string = GetEnv("NETDRIVE");

Syntax

GetField([recname.fieldname])

Description

Use the GetField function to create a reference to a field object for the current context; that is, from the row containing the currently executing program.

If you do not specify recname.fieldname, the current field executing the PeopleCode is returned.

Note: For PeopleCode programs located in events that are not associated with a specific row, record, and field at the point of execution this function is invalid. That is, you cannot use this function in PeopleCode programs on events associated with high-level objects like pages or components. For events associated with record level programs (like component record), this function is valid, but it must be specified with a field name, as there is an assumed record, but no assumed field name.

When GetField is used with an associated record and field name on component buffer data, the following is assumed:

&FIELD = GetRow().recname.fieldname;

Parameters

Field or Control

Definition

recname.fieldname

If you do not want to refer to the field executing the PeopleCode, specify a record name and field name.

Returns

This function returns a field object that references the field from the specified record.

Example

Local Field &CHARACTER; 
 
&CHARID = GetField(FIELD.CHAR_ID);

Syntax

GetFile(filename, mode [, charset] [, pathtype])

Description

Use the GetFile function to instantiate a new file object from the File class, associate it with an external file, and open the file so you can use File class methods to read from or write to it.

Any file opened for writing (using a call to the GetFile function or the File class Open method) by a PeopleCode program that runs in the Process Scheduler is automatically managed by the Report Repository.

You can use the GetFile or GetTempFile functions to access an external file, but each execution of GetFile or GetTempFile instantiates a new file object. If you plan to access only one file at a time, you need only one file object. Use GetFile or GetTempFile to instantiate a file object for the first external file you access. Then, use Open to associate the same file object with as many different external files as you want. However, if you expect to have multiple files open at the same time, you need to instantiate multiple file objects with GetFile or GetTempFile.

GetFile and Open both perform implicit commits. Therefore, the GetTempFile function has been introduced specifically to avoid these implicit database commits. GetTempFile differs from GetFile in two respects:

  • GetTempFile does not perform an implicit commit.

  • GetTempFile does not make the associated file available through the Report Repository even when the calling PeopleCode program is run through the Process Scheduler.

Therefore, GetTempFile can be a good choice when you wish to avoid implicit database commits and when you do not need to have the file managed through the Report Repository. Otherwise, GetTempFile operates exactly the same as GetFile.

See GetTempFile.

Parameters

Field or Control

Definition

filespec

Specify the name, and optionally, the path, of the file you want to open.

mode

A string indicating how you want to access the file. The mode can be one of the following:

  • "R" (Read mode): opens the file for reading, starting at the beginning.

  • "W" (Write mode): opens the file for writing.

    Warning! When you specify Write mode, any existing content in the file is discarded.

  • "A" (Append mode): opens the file for writing, starting at the end. Any existing content is retained.

  • "U" (Update mode): opens the file for reading or writing, starting at the beginning of the file. Any existing content is retained. Use this mode and the GetPosition and SetPosition methods to maintain checkpoints of the current read/write position in the file.

    In Update mode, any write operation clears the file of all data that follows the position you set.

    Note: Currently, the effect of the Update mode and the GetPosition and SetPosition methods is not well defined for Unicode files. Use the Update mode only on files stored with a non-Unicode character set.

  • "E" (Conditional "exist" read mode): opens the file for reading only if it exists, starting at the beginning. If it doesn’t exist, the Open method has no effect. Before attempting to read from the file, use the IsOpen property to confirm that it’s open.

  • "N" (Conditional "new" write mode): opens the file for writing, only if it doesn’t already exist. If a file by the same name already exists, the Open method has no effect. Before attempting to write to the file, use the IsOpen property to confirm that it’s open. You can insert an asterisk (*) in the file name to ensure that a new file is created. The system replaces the asterisk with numbers starting at 1 and incrementing by 1, and checks for the existence of a file by each resulting name in turn. It uses the first name for which a file doesn’t exist. In this way you can generate a set of automatically numbered files. If you insert more than one asterisk, all but the first one are discarded.

charset

A string indicating the character set you expect when you read the file, or the character set you want to use when you write to the file. You can abbreviate Unicode UCS-2 to "U" and the host operating system's default non-Unicode (sometimes referred to as the ANSI character set) to “A”. All other character sets must be spelled out in full, for example, ASCII, Big5, Shift-JIS, UTF8, or UTF8BOM.

If “A” is specified as the character set, or you do not specify a character set, the character set used is dependent on the application server configuration. On a Windows application server, the default non-Unicode character set is dependent on the Windows ANSI Codepage (ACP) which can be checked using the DOS command chcp. On a Unix application server, the default non-Unicode character set is specified in the application server configuration file, psappsrv.cfg, and can be modified using PSADMIN. You can also use a record field value to specify the character set (for example, RECORD.CHARSET.)

A list of supported character set names valid for this argument can be found in PeopleTools: Global Technology.

See Character Sets Across the Tiers of the PeopleSoft Architecture.

Note: If you attempt to read data from a file using a different character set than was used to write that data to the file, the methods used generate a runtime error or the data returned is unusable.

When a file is opened for reading using the “U” charset argument, GetFile expects the file to begin with a Unicode byte order mark (BOM). This mark indicates whether the file is written in big endian order or little endian order. A BOM consisting of the hex value 0xFEFF indicates a big endian file, a BOM consisting of the hex value 0xFFEF indicates a little endian file. If the Unicode UCS-2 file being opened does not start with a BOM, an error is returned. The BOM is automatically stripped from the file when it is read into the buffers by GetFile.

When a file is opened for writing using the “U” charset argument, the appropriate Unicode BOM is automatically written to the start of the file depending on whether the application server hardware platform operates in little endian or big endian mode.

BOMs are only expected or supported for files in Unicode character sets such as UTF8, UTF8BOM, and UCS2. For consuming applications that do expect the BOM for UTF-8 files, use the UTF8BOM character set to create UTF-8 files with the BOM.

Note: For example, the UTF-8 BOM is represented by the sequence 0xEF BB BF. This sequence can be misinterpreted by a non-Unicode character set such as ISO-8859-1 and appears as ISO characters .

When working with XML documents, specify UTF8 or UTF8BOM for charset. If you are writing an XML file using a different character set, you must remember to include a character set declaration in the XML file.

In some cases, a Unicode file (UCS-2 or UTF-8) cannot be opened. An error message is displayed, when one of the following error conditions is encountered:

  • If the character set is U (that is, UCS2) and the mode is:

    • A: The file is empty or the BOM is missing or incorrect.

    • R: The BOM is missing or incorrect.

    • W: The file does not exist, or adding the BOM failed.

  • If the character set is UTF8 or UTF8BOM and the mode is:

    • R: For UTF8BOM, the BOM is missing or the file is empty; for UTF8, the file is empty.

    • A or W: For UTF8BOM only, the file does not exist or adding the BOM failed.

pathtype

If you have prepended a path to the file name, use this parameter to specify whether the path is an absolute or relative path. The valid values for this parameter are:

  • %FilePath_Relative (default)

  • %FilePath_Absolute

If you don’t specify pathtype the default is %FilePath_Relative.

If you specify a relative path, that path is appended to the path constructed from a system-chosen environment variable. A complete discussion of relative paths and environment variables is provided in documentation on the File class.

See Working With Relative Paths.

If the path is an absolute path, whatever path you specify is used verbatim. You must specify a drive letter and the complete path. You can’t use any wildcards when specifying a path.

The Component Processor automatically converts platform-specific separator characters to the appropriate form for where your PeopleCode program is executing. On a Windows system, UNIX "/" separators are converted to "\", and on a UNIX system, Windows "\" separators are converted to "/".

Note: The syntax of the file path does not depend on the file system of the platform where the file is actually stored; it depends only on the platform where your PeopleCode is executing.

Note: The syntax of the file path does not depend on the file system of the platform where the file is actually stored; it depends only on the platform where your PeopleCode is executing.

Returns

A File object if successful; Null otherwise.

Example

The following example opens an existing UCS-2 file for reading:

&MYFILE = GetFile(&SOMENAME, "E", "U"); 
If &MYFILE.IsOpen Then 
   while &MYFILE.ReadLine(&SOMESTRING); 
      /* Process the contents of each &SOMESTRING */ 
   End-While; 
   &MYFILE.Close(); 
End-If;

The following example opens a numbered file for writing in a non-Unicode format, without overwriting any existing files:

&MYFILE = GetFile("c:\temp\item*.txt", "N", %FilePath_Absolute); 
If &MYFILE.IsOpen Then 
   &MYFILE.WriteLine("Some text."); 
   &MYFILE.Close(); 
End-If;

The following example uses the CHARSET field to indicate the character set to be used:

&MYFILE = GetFile("INPUT.DAT", "R", RECORD.CHARSET);

Syntax

GetGanttChart(RecordName.FieldName)

Description

Use the GetGanttChart function to get a reference to a Gantt object.

A chart must be associated with a record and field merely so that the chart object can be instantiated in PeopleCode. Which record and field you use doesn't matter. Commonly, the same derived/work record is used for all the charts in an application.

Parameters

Field or Control

Definition

RecordName.FieldName

Specify the record and field associated with the chart you want to get.

Returns

A reference to a Gantt object.

Example

&gGantt = GetGanttChart(CHARTREC_WRK.CHART_FLD);

Syntax

GetGaugeThreshold()

Description

Use the GetGaugeThreshold function to get a reference to a GaugeThreshold object. GaugeThreshold objects can then be associated with a RatingGaugeChart object.

Parameters

None.

Returns

A reference to a GaugeThreshold object.

Example

&oGTresh1 = GetGaugeThreshold();

Syntax

GetGrid(Page.page_name, grid_name, [L1_row_num])

Description

Use the GetGrid function to instantiate an object of the Grid class and populate it with the grid specified by grid_name. For grids at level 2, specify the optional L1_row_num parameter. The grid_name corresponds to the Page Field Name on the General tab of that grid’s page field properties.

Use the GetGrid function to return a reference to a Grid object. If you want to access an AnalyticGrid object, use the GetAnalyticGrid function instead.

Note: If more than one occurs count was specified for the grid in Application Designer, GetGrid will return only the first occurrence of the grid.

Note: PeopleSoft builds a page grid one row at a time. Because the Grid class applies to a complete grid, you can’t attach PeopleCode that uses the Grid class to events that occur before the grid is built; the earliest event you can use is the Activate event for a page.

See Activate Event.

Specifying the Grid Name

When you place a grid on a page, the grid is automatically named the same as the name of the primary record of the scroll for the grid (from the Page Field Name field) This is the name you use with the GetGrid function.

Note: If the name of the record changes, the Page Field Name is not automatically updated. You must change this name if you want the name of the grid to reflect the name of the record.

To change a grid name:

  1. Open the page definition in Application Designer.

  2. Select the grid and access the page field properties.

  3. On the General tab, type the new grid name in the Page Field Name field.

Note: Every grid on a page must have a unique name.

Parameters

Field or Control

Definition

Page.page_name

Specify the name of the page definition containing the grid you want.

grid_name

Specify the Page Field Name on the General tab of the grid’s page field properties.

Specify a grid name consisting of any combination of uppercase letters, digits and "#", "$", "@", and "_".

L1_row_num

Specify the row in the parent (level 1) scroll that contains this grid. Therefore, specify this parameter for grids at level 2 only.

Note: The default value is 1.

Returns

A Grid object populated with the requested grid.

Example

This example retrieves the grid named EMPL_GRID within a scroll:

local Grid &MYGRID; 
 
&MYGRID = GetGrid(Page.EMPLOYEE_CHECKLIST, "EMPL_GRID");

Syntax

GetHTMLText(HTML.textname [, paramlist])

Where paramlist is an arbitrary-length list of values of undetermined (Any) data type in the form:

inval1 [, inval2] ...

Description

Use the GetHTMLText function to retrieve a predefined HTML text from an HTML definition in the user's current language, or the base language if no entry exists in the user's current language. If any values are included in paramlist, they are substituted into the HTML text based on positional reference (for example, %BIND(:1) is the first parameter, %BIND(:2) is the second, and so on.)

Note: Use the GetHTMLText function only to retrieve HTML, or HTML that contains a JavaScript program, from an HTML definition. If you have an HTML definition that contains only JavaScript, use the GetJavaScriptURL response class method to access it.

See GetJavaScriptURL.

Restrictions on Use

Use this function with the PeopleSoft Pure Internet Architecture only. If run from a two-tier environment, the parameter substitution does not take place. This function cannot be used within Application Engine programs.

Parameters

Field or Control

Definition

HTML. textname

Specify the name of an existing HTML text from an HTML definition.

Returns

The resulting HTML text is returned as a string.

Example

The following is the text in the HTML definition TEST_HTML:

This is a %BIND(:1) and %BIND(:2) test.

The following is the PeopleCode program:

Local Field &HTMLfield; 
 
&string = GetHTMLText(HTML.TEST_HTML, "good", "simple"); 
&HTMLfield = GetRecord(Record.CHART_DATA).HTMLAREA; 
&HTMLfield.Value = &string;

The output from &string (displayed in an HTML area control) is:

This is a good and simple test. 

Syntax

GetImageExtents(IMAGE.ImageName)

Description

Use the GetImageExtents function to return the width and height of the image specified by ImageName.

Parameters

Field or Control

Definition

ImageName

Specify the name of the image on the page. This image must exist on the page.

Returns

An array of data type number, where element 1 is the image height and element 2 is the image width.

Example

Local array of number &ImageExtents; 
 
&ImageExtents = GetImageExtents(Image.PT_TREE_EXPANDED); 
 
WinMessage("Height is " | &ImageExtents[1] | " and width is " | &ImageExtents[2]);

Syntax

GetInterlink(Interlink.name)

Description

Use the GetInterlink function to instantiate a Business Interlink definition object based on a Business Interlink definition created in Application Designer. The Business Interlink object can provide a gateway for PeopleSoft applications to the services of any external system.

Note: Business Interlinks is a deprecated product. Use Integration Broker instead.

See PeopleTools: Integration Broker.

After you use this function, you may want to refresh your page. The Refresh rowset class reloads the rowset (scroll) using the current page keys. This causes the page to be redrawn. GetLevel0().Refresh() refreshes the entire page. If you only want a particular scroll to be redrawn, you can refresh just that part.

Generally, do not use the GetInterlink function in a program you create from scratch. If you drag a Business Interlink definition from the project workspace (in Application Designer) to an open PeopleCode editor window, a "template" is created, with values filled in based on the Business Interlink definition you dragged in.

The following is the template created from dragging the Business Interlink definition LDAP_SEARCHBIND to an open PeopleCode editor window.

/* ===> 
   This is a dynamically generated PeopleCode template to be used only as a helper
 to the application developer.  You need to replace all references to '<*>' OR
 default values with  references to PeopleCode variables and/or a Rec.Fields.*/ 
 
/* ===> Declare and instantiate: */ 
Local Interlink &LDAP_SEARCHBI_1; 
Local BIDocs &inDoc; 
Local BIDocs &outDoc; 
Local Boolean &RSLT; 
Local number  &EXECRSLT; 
&LDAP_SEARCHBI_1 =  GetInterlink(INTERLINK.LDAP_SEARCHBIND); 
 
/* ===> You can use the following assignments to set the configuration parameters. 
*/ 
 
&LDAP_SEARCHBI_1.Server = "example.com"; 
&LDAP_SEARCHBI_1.Port = 389; 
&LDAP_SEARCHBI_1.User_DN = "cn=Admin,o=PeopleSoft"; 
&LDAP_SEARCHBI_1.Password = &password; 
&LDAP_SEARCHBI_1.UserID_Attribute_Name = "uid"; 
&LDAP_SEARCHBI_1.URL = "///file:C:/User/Documentum/XML%20Applications/proddoc/
peoplebook_upc/peoplebook_
upc.dtd"; 
&LDAP_SEARCHBI_1.BIDocValidating = "Off"; 
 
 
/* ===> You might want to call the following statement in a loop if there is more than one row of data to be added.  */ 
 
/* ===> Add inputs: */ 
&inDoc = &LDAP_SEARCHBI_1.GetInputDocs(""); 
&ret = &inDoc.AddValue("User_ID", <*>); 
&ret = &inDoc.AddValue("User_Password", <*>); 
&ret = &inDoc.AddValue("Connect_DN", <*>); 
&ret = &inDoc.AddValue("Connect_Password", <*>); 
&Directory_Search_ParmsDoc = &inDoc.AddDoc("Directory_Search_Parms"); 
&ret = &Directory_Search_ParmsDoc.AddValue("Host", <*>); 
&ret = &Directory_Search_ParmsDoc.AddValue("Port", <*>); 
&ret = &Directory_Search_ParmsDoc.AddValue("Base", <*>); 
&ret = &Directory_Search_ParmsDoc.AddValue("Scope", <*>); 
&ret = &Directory_Search_ParmsDoc.AddValue("Filter", <*>); 
 
 
/* ===> The following statement executes this instance: */ 
&EXECRSLT = &LDAP_SEARCHBI_1.Execute(); 
If ( &EXECRSLT <> 1 ) Then 
   /* The instance failed to execute */ 
Else 
&outDoc = &LDAP_SEARCHBI_1.GetOutputDocs(""); 
&ret = &outDoc.GetValue("Distinguished_Name", <*>); 
&ret = &outDoc.GetValue("return_status", <*>); 
&ret = &outDoc.GetValue("return_status_msg", <*>); 
End-If; /* If NOT &RSLT ...  */

Parameters

Field or Control

Definition

Interlink. name

Specify the name of the Business Interlink definition from which to instantiate a Business Interlink object.

Returns

A Business Interlink object.

Example

The following example instantiates a Business Interlink object based on the Business Interlink definition QE_RP_SRAALL.

Local Interlink &SRA_ALL_1; 
 
&SRA_ALL_1 = GetInterlink(Interlink.QE_RP_SRAALL);

Syntax

GetJavaClass(ClassName)

Description

Use the GetJavaClass function to access a Java class so that you can manipulate it in PeopleCode. This is used for those classes that have static members, where it isn't appropriate to instantiate an object of the class. You can call only static methods, that is, class methods, with the object created with this function.

In Java, you access such static members of a class by using the class name:

result = java.class.name.SomeStaticMethod();

To do this in PeopleCode, do the following:

&Result = GetJavaClass("java.class.name").SomeStaticMethod();

Note: If you create a class that you want to call using GetJavaClass, it can be located in a directory specified in the PS_CLASSPATH environment variable or in other specified locations. The PeopleCode API Reference provides details on where you can place custom and third-party Java classes.

See System Setup for Java Classes.

Parameters

Field or Control

Definition

ClassName

Specify the name of an already existing class. This parameter takes a string value.

Returns

A JavaObject that refers to the named Java class.

Example

The Java class java.lang.reflect.Array has no public constructors and has only static methods. The methods are used to manipulate Java array objects. One of these static methods is GetInt:

public static int getInt(Object array, int index)

To use this method, get the class by using GetJavaClass. This code illustrates accessing the value of the fifth element of an integer array.

Local JavaObject &RefArray, &MyArray;
. . .
&RefArray = GetJavaClass("java.lang.reflect.Array");
. . .
&MyArray = CreateJavaArray(“int[]”, 24);
. . .
&FifthElement = &RefArray.getInt(&MyArray, 4);

Syntax

GetLEDGauge(RecordName.FieldName)

Description

Use the GetLEDGauge function to get a reference to an LEDGauge object.

A gauge must be associated with a record and field merely so that the gauge object can be instantiated in PeopleCode. Which record and field you use doesn't matter. Commonly, the same derived/work record is used for all the charts in an application.

Parameters

Field or Control

Definition

RecordName.FieldName

Specify the record and field name associated with the LED gauge.

Returns

A reference to an LEDGauge object.

Example

&MyGauge = GetLEDGauge(GAUGEREC_WRK.GAUGE_FLD);

Syntax

GetLevel0()

Description

Use the GetLevel0 function to create a rowset object that corresponds to level 0 of the component buffer. If used from PeopleCode that isn’t associated with a page, it returns the base rowset from the current context.

Parameters

GetLevel0 has no parameters. However, it does have a default method, GetRow, and a shortcut. Specifying GetLevel0()(1) is the equivalent of specifying GetLevel0().GetRow(1).

Returns

This function returns a rowset object that references the base rowset. For a component, this is the level 0 of the page. For a Application Engine program, this is the state record rowset. For a message, this is the base rowset.

Note: You can also get the base rowset for a message using the GetRowset message class method, that is, &MSG.GetRowset().

Example

The following code sample returns the level one rowset.

Local Rowset &ROWSET;
&ROWSET = GetLevel0().GetRow(1).GetRowset(SCROLL.LEVEL1_REC);

The following is equivalent to the previous example.

Local Rowset &ROWSET;
&ROWSET = GetLevel0()(1).GetRowset(SCROLL.LEVEL1_REC);

To reference a level 2 rowset you would have code similar to this:

Local Rowset &ROWSET_LEVEL2, &ROWSET_LEVEL0, &ROWSET_LEVEL1;
&ROWSET_LEVEL2 = GetLevel0().GetRow(1).GetRowset(SCROLL.LEVEL1_REC).GetRow(5). 
 GetRowset(SCROLL.LEVEL2_REC);
   /* or */
&ROWSET_LEVEL0 = GetLevel0(); 
&ROWSET_LEVEL1 = &ROWSET_LEVEL0.GetRow(1).GetRowset(SCROLL.LEVEL1_REC); 
&ROWSET_LEVEL2 = &ROWSET_LEVEL1.GetRow(5).GetRowset(SCROLL.LEVEL2_REC); 
   /* or */
&ROWSET_LEVEL2 = GetLevel0()(1).LEVEL1_REC(5).GetRowset(SCROLL.LEVEL2_REC); 

Syntax

GetMethodNames(Type, Name)

Description

Use the GetMethodNames function to return either the method names for a Component Interface, or the function names of a WEBLIB record.

Parameters

Field or Control

Definition

Type

Specify the type of methods or functions you want returned. This parameter takes a string value. The values are:

  • WebLib

  • CompIntfc

Name

Specify the name of the Component Interface or WEBLIB record that you want to know the methods or functions for.

Returns

An array of string containing the method or function names.

Example

Local array of string &Array;
&Array = GetMethodNames("CompIntfc", CompIntfc.USER_PROFILE);
&Array = GetMethodNames("WebLib", Record.WEBLIB_PORTAL);

Syntax

GetMessage()

Description

Use the GetMessage function to return a message.

Note: This function has been deprecated and remains for backward compatibility only. Use the IntBroker class GetMessage method instead.

It retrieves a message from the message queue for the current message being processed.

Note: The GetMessage function does not load the message with data. It always creates a new instance of a message object. You must use another method, such as GetRowset, to populate the message object. In addition, you must populate the message object with data before running any methods on it.

Related Links

GetMessage

Parameters

None.

Returns

A reference to an empty message object if successful, NULL if not successful.

Example

Local message &MSG; 
&MSG = GetMessage();

Syntax

GetMessageInstance(pub_id, pub_nodename, channelname)

Description

Use the GetMessageInstance function to get a message from the message queue.

Note: This function has been deprecated and is no longer supported.

Syntax

GetMessageXmlDoc()

Description

Use the GetMessageXmlDoc function in any of the messaging PeopleCode events.

Note: This function has been deprecated and remains for backward compatibility only. Use the Message class GetXMLDoc method instead.

It retrieves an XML message, either from the message queue for asynchronous messages, or in memory for synchronous messages, for the current message being processed. An XML message is a message that is unstructured, that is, isn't based on a record hierarchy. It creates and loads a data tree for the default message version, and returns NULL if not successful.

Related Links

GetXmlDoc

Parameters

None.

Returns

A reference to an XmlDoc object if successful, NULL if not successful.

Example

The following example uses the GetMessageXmlDoc built-in function.

Local XmlDoc &BIGMAN; 
Local XmlNode &node, &root; 
Local string &outstring; 
Local Rowset &LEVEL0; 
Local Record &SALES_ORDER_INFO, &REC; 
 
&CRLF = Char(13) | Char(10); 
 
&BIGMAN = GetMessageXmlDoc(); 
 
&root = &BIGMAN.DocumentElement; 
&child_count = &root.ChildNodeCount; 
 
/* Get values out of XMLDoc */ 
&node_array = &root.GetElementsByTagName("QE_ACCT_ID"); 
&acct_id_node = &node_array.Get(2); 
&account_id_value = &acct_id_node.NodeValue; 
 
&node_array = &root.GetElementsByTagName("QE_ACCOUNT_NAME"); 
&acct_name_node = &node_array.Get(2); 
&account_name_value = &acct_name_node.NodeValue; 
 
&node_array = &root.GetElementsByTagName("QE_ADDRESS"); 
&address_node = &node_array.Get(2); 
&address_value = &address_node.NodeValue; 
 
&node_array = &root.GetElementsByTagName("QE_PHONE"); 
&phone_node = &node_array.Get(2); 
&phone_value = &phone_node.NodeValue; 
 
&outstring = "GetMessageXMLDoc Test"; 
&outstring = &outstring | &CRLF | &account_id_value | &CRLF | &account_name_value
 | &CRLF | &address_value | &CRLF | &phone_value; 
 
&SALES_ORDER_INFO = CreateRecord(Record.QE_SALES_ORDER); 
&SALES_ORDER_INFO.GetField(Field.QE_ACCT_ID).Value = &account_id_value; 
&SALES_ORDER_INFO.GetField(Field.DESCRLONG).Value = &outstring; 
&SALES_ORDER_INFO.Update();

Syntax

GetNextNumber({record.field | record_name, field_name}, max_number)

Description

Use the GetNextNumber function to increment the value in a record for the field you specify by one and returns that value. You might use this function to increment an employee ID field by one when you are adding a new employee. If the new value generated exceeds max_number, a negative value is returned and the field value isn't incremented.

The maximum value possible for max_number is 2147483647.

PeopleCode Event Considerations

Because this function results in a database update (specifically, UPDATE, INSERT, and DELETE) it should only be issued in the following events:

  • SavePreChange

  • WorkFlow

  • SavePostChange

If you use this function in an event other than these, you need to ensure that the dataflow is correct and that you do not receive unexpected results.

GetNextNumber and GetNextNumberWithGapsCommit

The following is some of the differences between the two functions, to enable you to better chose which one is better for your application.

GetNextNumber

GetNextNumberWithGapsCommit

No AutoCommit (which can be a problem, as the table is locked until all Save events are finished.)

AutoCommit (this can be a performance enhancement as table is not locked as long).

Ability to use WHERE criteria for maintaining multiple sequence numbers in a single record.

Ability to increment by more than 1.

Allowed in SavePostChange

Can be used in any PeopleCode event.

Parameters

Field or Control

Definition

record.field

Specify the record and field identifiers for the field for which you want the new number. This is the recommended way to identify the field.

record_name

Specify as a string the name of the record containing the field for which you want the new number. This parameter with field_name was used prior to PeopleTools 8.

field_name

Specify as a string the name of the field for which you want the new number. This parameter with record_name was used prior to PeopleTools 8.

Note: If you use the older syntax (record_name, field_name), you have to manually update these two parameters in your programs whenever that record or field is renamed. The new syntax (record.field) is automatically updated, so you won't have to maintain it.

max_number

Specify the highest allowed value for the field you're incrementing. The maximum value possible for max_number is 2147483647.

Returns

A Number value equal to the highest value of the field specified plus one.

GetNextNumber returns an error if the value to be returned would be greater than max_number. The function returns one of the following:

Numeric Value

Constant Value

Description

Number

N/A 

The new number

-1

%GetNextNumber_SQLFailure

SQL failure

-2

%GetNextNumber_TooBig

Number too large, beyond max_number

-3

%GetNextNumber_NotFound

No number found, invalid data format

Example

If %Component = "RUN_AR33000" Then 
   DUN_ID_NUM = GetNextNumber(INSTALLATION_AR.DUN_ID_NUM, 99999999); 
End-if;

The following uses the constant to check for the value returned:

&VALUE = GetNextNumber(INSTALLATION_AR.DUN_ID_NUM, 999); 
 
Evaluate &VALUE 
When = %GetNextNumber_SQLFailure 
     /* do processing */ 
When = %GetNextNumber_TooBig 
     /* do processing */ 
When = %GetNextNumber_NotFound 
     /* Do processing */ 
When-other 
     /* do other processing */ 
End-Evaluate;

Syntax

GetNextNumberWithGaps(record.field, max_number, increment [, WHERE_Clause, paramlist])

Where paramlist is an arbitrary-length list of values in the form:

var1 [, var2] ...

Description

Use the GetNextNumberWithGaps function to determine the highest value in a table for the field you specify, and return that value plus increment.

Note: This function has been deprecated and remains for backward compatibility only. Use the GetNextNumberWithGapsCommit function instead.

This function also enables you to specify a SQL WHERE clause as part of the function for maintaining multiple sequence numbers in a single record.

Note: GetNextNumberWithGaps also issues a COMMIT after incrementing the sequence number if no other database updates have occurred since the last COMMIT. This limits the time a database lock is held on the row and so may improve performance.

PeopleCode Event Considerations

Because this function results in a database update (specifically, UPDATE, INSERT, and DELETE) it should only be issued in the following events:

  • SavePreChange

  • WorkFlow

If you use this function in an event other than these, you need to ensure that the dataflow is correct and that you do not receive unexpected results.

Parameters

Field or Control

Definition

record.field

Specify the record and field identifiers for the field for which you want the new number. This is the recommended way to identify the field.

max_number

Specify the highest allowed value for the field you're incrementing. You can specify up to 31 digits for this value.

increment

Specify the value you want the numbers incremented by. You can specify up to 31 digits for this value.

WHERE_Clause

Specify a WHERE clause for maintaining multiple sequence numbers.

paramlist

Parameters for the WHERE clause.

Returns

A Number value equal to the highest value of the field specified plus one.

GetNextNumberWithGaps returns an error if the value to be returned would be greater than max_number. The function returns one of the following:

Numeric Value

Constant Value

Description

Number

N/A 

The new number

-1

%GetNextNumber_SQLFailure

SQL failure

-2

%GetNextNumber_TooBig

Number too large, beyond max_number

-3

%GetNextNumber_NotFound

No number found, invalid data format

Example

The following PeopleCode:

&greg = GetNextNumberWithGaps(GREG.DURATION_DAYS, 999999, 50, 
"where emplid = :1", 8001); 

results in the following:

2-942   21.53.09    0.000 Cur#4.PTTST81B RC=0 Dur=0.000 Connect=PTTST81B/sa/ 
2-943   21.53.09    0.000 Cur#4.PTTST81B RC=0 Dur=0.000 COM Stmt=UPDATE PS_GREG
 SET DURATION_DAYS = DURATION_DAYS + 50 where emplid = 8001 
2-944   21.53.09    0.000 Cur#4.PTTST81B RC=0 Dur=0.000 EXE 
2-945   21.53.09    0.000 Cur#4.PTTST81B RC=0 Dur=0.000 COM Stmt=SELECT DURATION_
DAYS FROM PS_GREG where emplid = 8001 
2-946   21.53.09    0.000 Cur#4.PTTST81B RC=0 Dur=0.000 EXE 
2-947   21.53.09    0.000 Cur#4.PTTST81B RC=0 Dur=0.000 Fetch 
2-948   21.53.09    0.010 Cur#4.PTTST81B RC=0 Dur=0.010 Commit 
2-949   21.53.09    0.010 Cur#4.PTTST81B RC=0 Dur=0.010 Disconnect

Syntax

GetNextNumberWithGapsCommit(record.field, max_number, increment [, WHERE_Clause, paramlist])

Where paramlist is an arbitrary-length list of values in the form:

var1 [, var2] ...

Description

Use the GetNextNumberWithGapsCommit function to return the sequence number value plus increment for the given field residing in the given record. This function also enables you to specify a SQL Where clause as part of the function for maintaining multiple sequence numbers in a single record.

This function is typically used for obtaining a new sequence number for the application, for example, getting a new Purchase Order number to be used in the application transaction.

Use this function instead of the GetNextNumberWithGaps function. The GetNextNumberWithGaps function is very restrictive in its usage. The GetNextNumberWithGapsCommit function can be used in any event. The sequence number (record.field ) is incremented right away and it doesn't hold any database internal row lock beyond the execution of this function.

Note: A secondary database connection is used to increment and retrieve record.field. The default behavior is to keep the secondary database connection persistent in order to improve performance for the next GetNextNumberWithGapsCommit usage. If the database administrator finds the persistent connection too high an overhead for the production environment (which should not be the case since PeopleSoft uses application server to mulitplex the database connection), the database administrator can change the default behavior to use an on-demand connection method. The persistent second connection is disabled using DbFlags bit eight in the application server and process scheduler configuration files. The second connection can be completely disabled using DbFlags bit four in the application server and process scheduler configuration files

Considerations Using GetNextNumberWithGapsCommit

The following restrictions apply to the GetNextNumberWithGapsCommit function:

  • PeopleSoft does not recommend Using both the GetNextNumberWithGapsCommit function and the GetNextNumber function in the same application, on the same table, in the same unit of work. This can lead to lock contention or deadlocking.

  • For a DB2 UDB for z/OS database, isolate the table that contains the sequence number to its own tablespace and set the locksize parameter to row.

Related Links

DbFlags

Parameters

Field or Control

Definition

record.field

Specify the record and field names for the field for which you want the new number. This is the recommended way to identify the field.

max_number

Specify the highest allowed value for the field you're incrementing. You can specify up to 31 digits for this value.

increment

Specify the value you want the numbers incremented by. You can specify up to 31 digits for this value.

WHERE_Clause

Specify a SQL Where clause for maintaining multiple sequence numbers.

paramlist

Specify the parameters for the SQL Where clause.

Returns

A number value equal to the highest value of the field specified plus one increment.

The GetNextNumberWithGapsCommit function returns an error if the value to be returned would be greater than max_number. The function returns one of the following:

Numeric Value

Constant Value

Description

Number

None

The new number

-1

%GetNextNumber_SQLFailure

SQL failure

-2

%GetNextNumber_TooBig

Number returned is too large, beyond max_number.

-3

%GetNextNumber_NotFound

No number found, invalid data format.

Example

The following PeopleCode increments the MCF_EMAIL_ID field by one and returns the new value, committing immediately.

&LAST_AUTO_NBR = GetNextNumberWithGapsCommit(MCF_INSTALL.MCF_EMAIL_ID, 2147483647,
 1);

The above code produces output similar to the following:

1-192    10.39.54    0.320 Cur#2.1980.DB844901 RC=0 Dur=0.320 Connect=Secondry
/DB844901/testdb2/
1-193    10.39.54    0.000 GNNWGC ---- Successful obtain Second DB connection 
1-194    10.39.54    0.010 Cur#2.1980.DB844901 RC=0 Dur=0.010 COM Stmt=UPDATE PS_
MCF_INSTALL SET MCF_EMAIL_ID = MCF_EMAIL_ID + 1 
1-195    10.39.54    0.000 Cur#2.1980.DB844901 RC=0 Dur=0.000 COM Stmt=SELECT MCF_
EMAIL_ID FROM PS_MCF_INSTALL 
1-196    10.39.54    0.000 Cur#2.1980.DB844901 RC=0 Dur=0.000 Commit
1-197    10.39.54    0.000 Cur#2.1980.DB844901 RC=0 Dur=0.000 Disconnect

Syntax

GetNextProcessInstance([Commit])

Description

Use the GetNextProcessInstance function to retrieve the next available process instance from the Process Scheduler System table. When determining to find the next process instance in the sequence, the function ensures the next available process instance does not exist in both the Process Request and Message Log tables.

By default, the function commits the changes to the Process Scheduler system table to set it to the next available process instance for the next available request. If this function is called within a PeopleCode function for which issuing a COMMIT to the database destroys a unit of work, specify "0" for Commit.

Parameters

Field or Control

Definition

Commit

Specify whether the current data instance should be committed to the database. This parameter takes a string value: "1", commit the data, "0", do not commit the data. "1" is the default value.

Returns

An integer representing the next available process instance if successful, otherwise 0 in case of a failure.

Syntax

GetNRXmlDoc(NRID, EntityName)

Description

Use the GetNRXmlDoc function in any of the messaging PeopleCode events. It retrieves an XML message, categorized as non-repudiation, from the message queue for the specified non-repudiation ID. An XML message is a message that is unstructured, that is, isn't based on a record hierarchy. It creates and loads a data tree for the default message version, and returns Null if not successful.

Parameters

Field or Control

Definition

NRID

Specify the non-repudiation ID for the XML message that you want to retrieve. This parameter takes a numeric value.

EntityName

Specify the name of the entity that signed the data, as a string. For Peoplesoft, this is the node name.

Returns

A reference to an XmlDoc object if successful, Null if not successful.

Syntax

GetOrgChart(RecordName.FieldName)

Description

Use the GetOrgChart function to get a reference to an OrgChart object.

A chart must be associated with a record and field merely so that the chart object can be instantiated in PeopleCode. Which record and field you use doesn't matter. Commonly, the same derived/work record is used for all the charts in an application.

Parameters

Field or Control

Definition

RecordName.FieldName

Specify the record and field associated with the chart you want to get.

Returns

A reference to a an OrgChart object.

Example

&ocOrgChart = GetOrgChart(CHARTREC_WRK.CHART_FLD);

Syntax

GetPage(PAGE.pagename)

Description

Use the GetPage function to return a reference to a page object. Generally, page objects are used to hide or unhide pages in a component.

Generally, the PeopleCode used to manipulate a page object would be associated with PeopleCode in the Activate event.

Note: The page object shouldn’t be used until after the Component Processor has loaded the page: that is, don’t instantiate this object in RowInit PeopleCode, use it in PostBuild or Activate instead.

Note

An expression of the form

PAGE.name.property

is equivalent to GetPage(name).property.

Parameters

Field or Control

Definition

PAGE. pagename

The name of the page for which you want to create an object reference. Must be a page in the current context.

Returns

A page object that references the page.

Example

In the following example, a page is hidden based on the value of the current field.

If PAYROLE_TYPE = "Global" Then 
   GetPage(PAGE.JOB_EARNINGS).Visible = False; 
End-If;

Syntax

GetPageField(Page.pagename, [scrollpath. [target_row, ]] page_field_name)

where scrollpath is:

[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ]] RECORD.target_recname

To prevent ambiguous references, you can use SCROLL. scrollname, where scrollname is the same as the scroll level’s primary record name.

Description

Use the GetPageField function to reference a specific page field anywhere in the current component. Generally, you will need to use GetPageField to reference radio buttons, which represent multiple instances of a record field.

Note: The page field name is not the same as the record field name. The page field name is the name specified on the General tab for the page field properties in the page definition in Application Designer.

The GetField function, by contrast, uses the record field name as an argument.

If you need to reference a field that is unique in the current context, you can use the GetField function.

See Idiv, Idiv, GetField, Understanding Current Context.

Parameters

Field or Control

Definition

Pagename

The name of the page specified in the page definition, preceded by the keyword Page. The pagename page must be in the current component. You can also pass the %page system variable in this parameter (without the Page reserved word).

scrollpath

A construction that specifies a scroll level in the component buffer. This parameter is optional. The default is the current scroll.

target_row

The row number of the row in which the field occurs. This parameter is optional. The default is the current row.

page_field_name

The name of the page field specified in the page field properties in the page definition.

Returns

This function returns a field object that references a specific instance of a page field in the component buffer.

Example

The following example initializes four Field objects to four specific radio button page fields and conditionally sets their labels to either a long version or a short version.

&Fld1 = GetPageField(Page.GNNWG_PAGE, "INITIALIZE"); 	/* Initialize Radio Button */
&Fld2 = GetPageField(Page.GNNWG_PAGE, "COMMIT"); 	/* Commit Radio Button */
&Fld3 = GetPageField(Page.GNNWG_PAGE, "ROLLBACK"); 	/* Rollback Radio Button */
&Fld4 = GetPageField(Page.GNNWG_PAGE, "SAMFAIL"); 	/* SAMFAIL Radio Button */

If &SetLabel = "Long"  Then 
   &Fld1.Label = "Initialize_Long_Label_Name";
   &Fld2.Label = "Commit_Long_Label_Name";
   &Fld3.Label = "Rollback_Long_Label_Name";
   	&Fld4.Label = "SAMFAIL_Long_Label_Name";
Else
   &Fld1.Label = "Initialize";
   &Fld2.Label = "Commit";
   &Fld3.Label = "Rollback";
   &Fld4.Label = "SAMFAIL";
End-If;

Even though all of the radio buttons represent the same record field, GetPageField enables you to reference each radio button individually.

Syntax

GetPagePrefix(page_type)

Description

Use the GetPagePrefix function to return the prefix for the page based on the page type as set on the Use tab.

Important! Use this function within fluid applications only.

Parameters

Field or Control

Definition

page_type

Specifies the page type as an Integer value.

Returns

A String value:

  • "" = Standard Page

  • ftr = Footer Page

  • hdr - Header page

  • side = Side Page 1

  • side2 = Side Page 2

  • srch = Search Page

Example

Local string &pg_pre = GetPagePrefix(GetPageType(Page.PAGE_NAME));

Syntax

GetPageTitle()

Description

Use the GetPageTitle function to return the title of the page.

Important! Use this function within fluid applications only.

Parameters

None.

Returns

A string value.

Example

PTLAYOUT.PAGETITLE_GROUPBOX.Label = GetPageTitle();

Syntax

GetPageType(Page.PAGE_NAME)

Description

Use the GetPageType function to return the page type—for example, header, footer, prompt, and so on.

Important! Use this function within fluid applications only.

Parameters

Field or Control

Definition

Page.PAGE_NAME

Specifies the page ID as a string value. Alternatively, you can use the %Page system variable (without the Page. reserved word) to specify the current page.

Returns

One of the following Integer values:

Numeric Value

Constant Value

Description

0

%MainPage

The main, or primary fluid page. A main fluid page definition includes the outermost group box that acts as the overall container for the fluid page content.

1

%SubPage

A standard subpage that contains a grouping of fields—such as an address block—which is defined to be reusable within multiple other page definitions.

2

%SecondaryPage

A standard secondary page that you access through another page, usually by clicking a link or push button.

3

%PopupPage

A standard, display-only pop-up page that you access through another page, usually by clicking a link or push button.

4

%HeaderPage

A page displayed in the <header> section of the HTML acting as the banner area fixed at the top of every page within the fluid component.

5

%SidePage

%SidePage1

A page of type Side Page 1 (left panel).

6

%FooterPage

A page displayed in the <footer> section of the HTML at the bottom of every page within the fluid component, containing elements related to the end of a transaction, such as a Save button.

7

Constant value to be defined in a future release.

A fluid page layout template.

Note: Do not include layout pages within a fluid component definition.

8

Constant value to be defined in a future release.

A page generated in <aside> section containing search pages.

9

Constant value to be defined in a future release.

A fluid prompt page.

10

Constant value to be defined in a future release.

A Master&Detail Target page that displays the transactional fluid page for use within a master/detail component.

11

Constant value to be defined in a future release.

A page of type Side Page 2 (right panel).

Example

If GetPageType(Page.QE_NUI_SHOP_FT) <> %FooterPage Then
...
End-If;
If GetPageType(Page.QE_NUI_SHOP_SIDE) <> %SidePage Then
...
End-If;

Syntax

GetPanelControlStyle()

Description

Use the GetPanelControlStyle function to return the styles set by the system that control the state of the left and right panels as a String value.

Important! Use this function within fluid applications only.

Parameters

None.

Returns

A String value.

Example

method Initialize
   /* … */
   &m_oCSS = create PT_PAGE_UTILS:Styles(GetPanelControlStyle());
   /* … */
end-method;

Syntax

GetProgramFunctionInfo(ProgramId)

Where ProgramId is the following for PeopleCode user-defined functions:

RECORD.RecordName.FIELD.FieldName.METHOD.MethodName

Where ProgramId is the following for Component Interface user-defined methods:

COMPONENTINTERFACE.CIName.METHODS.Methods

Description

Use the GetProgramFunctionInfo function to determine the full signature and return values of a PeopleCode user-defined function, or a Component Interface method.

Considerations Using Component Interfaces

Component Interfaces only support type conversion of primitive data types back and forth between PeopleCode values and those using inside Component Interface processing.

Component Interface processing traps all errors that occur inside the invocation of the Component Interface and on failure simply returns a false value.

Parameters

Field or Control

Definition

ProgramId

Specify the full name of the function or the Component Interface method, as a string.

Returns

An array of array of any.

There is one array for every function or method defined in the program. Each array contains the following information:

  1. The name of the function.

  2. The signature of the parameters as a comma-separated string (see additional information below.)

  3. The signature of the result (see result list below.)

  4. The annotation of the Doc tag.

  5. A boolean indicator of whether this function is to be exported (as indicated by the noexp tag).

  6. A boolean indicator of whether this function is permitted to be called by this user. This only makes sense for Functions defined as CI methods in Component Interface PeopleCode. The default value is True.

The parameters may be modified by the following values:

Value

Description

?

An optional parameter.

*

A repeated parameter.

&

A parameter reference (PARM_NAME)

The possibly values of the result are as follows. Note the use of both lower and upper case letters.

Value

Description

D

Dec

d

Date

S

String

A

Any

B

Boolean

V

None

t

Time

T

DateTime

I

Image

i

Integer

O

Object

f

Float

9

Number

x

Unknown

[<value>

Array

A single bracket indicates a single array. Two brackets indicates a two-dimensional array, three brackets a three-dimensional array, and so on.

The value following the bracket indicates the type of array. For example, [i indicates an array of integer, [[S indicates an array of array of string.

Example

In the following example, this code is associated with the record QE_ABSENCE_HIST, on the field QE_REASON, in the FieldChange event.

Function Update(&1 As string) Returns number NoExport
   Doc "this is some attached annotation"
   Return 1.23;
End-Function;
/* everything else . . */

The following PeopleCode program:

Local array of array of any &r;
&r = GetProgramFunctionInfo("RECORD.QE_ABSENCE_HIST.FIELD.QE_REASON.METHOD.Field
Change");

Returns a two-dimensional array with a single row that contains the following:

&r[1][1] – the name of the function “Update”

&r[1][2] – the signature of the parameter “S&”

&r[1][3] – the signature of the result “9”

&r[1][4] – the annotation of the doc tag “this is some attached annotation”

&r[1][5] – a boolean indicator of whether this function is to be exported. In this case it returns false.

The following example is used with a Component Interface program:

Function Update(&1 As string) Returns number NoExport
   Doc "this is some attached annotation"
   Return 1.23;
End-Function;

Function Updateagain(&1 As string) Returns number
   Doc "this is some more attached annotation"
   Return 1.23;
End-Function;

Local File &log;

Function LogText(&msg As string)
   If &log = Null Then
      Return
   End-If;
   &log.WriteLine(&msg);
End-Function;


Function CreateCI(&Name As string) Returns ApiObject
   Local ApiObject &CI;
   /** Get Component Interface **/
   &CI = %Session.GetCompIntfc(@("CompIntfc." | &Name));
   /* instantiate */
   &CI.PROCESSNAME = "AEMINITEST";
   &CI.PROCESSTYPE = "Application Engine";
   &CI.RUNCONTROLID = 99;
   &CI.Create();
   Return &CI;
End-Function;

Function DisplayProgramFuncInfo(&r As array of array of any)
   
   Local integer &i;
   
   For &i = 1 To &r.Len
      Local string &o;
      &o = &r [&i][1] | "(" | &r [&i][2] | ";" | &r [&i][3] | ") doc '" 
      | &r [&i][4] | "'";
      If &r [&i][5] = 0 Then
         &o = &o | " noexport ";
      Else
         &o = &o | " export ";
      End-If;
      If &r [&i][6] = 0 Then
         &o = &o | " no permission ";
      Else
         &o = &o | " permitted ";
      End-If;
      LogText(&o);
   End-For;
End-Function;

Function SetupParameters(&Names As array of string, &Sigs As array of string)
 Returns array of any
   Local array of any &p = CreateArrayAny();
   Local integer &i;
   
   /* could use the parameter name to get values out of a dom?? */
   /* Base types we could handle
//  D = Dec
//  S = String
//  d = Date
//  A = Any
//  B = Boolean
//  V = None
//  t = Time
//  T = DateTime
//  I = Image
//  O = Object
//  i = Integer
//  f = Float
//  9 = Number
//  x = Unknown
*/
   For &i = 1 To &Sigs.Len
      Local string &parName = RTrim(LTrim(&Names [&i + 1])); 
/* first name is create/get/?? */
      /* Here is where you'd get the value for this particular parameter 
 and then push it properly onto the parameter array */
      Evaluate Substring(&Sigs [&i], 1, 1)
      When = "D"
         &p.Push(1);
         Break;
      When = "S"
         &p.Push("String for " | &parName);
         Break;
      When = "9"
      When = "i"
         &p.Push(&i);
         Break;
      When-Other
         &p.Push("Unimplemented . . .");
      End-Evaluate
   End-For;
   
   Return &p;
End-Function;

Function CallUDMMethod(&ci As ApiObject, &funcInfo As array of array of any,
 &methodName As string) Returns any
   
   /* an example of calling a user defined method on a ci */
   
   /* 1. find it in the funcinfo */
   Local integer &i = 1;
   Local integer &nFuncs = &funcInfo.Len;
   
   While &i <= &nFuncs
      /* name should match and it should be exportable (the default) 
		 and the doc tag should have something in it 
		 and it should be permitted */
      If &funcInfo [&i][1] = &methodName And
            &funcInfo [&i][5] <> 0 And
            Len(&funcInfo [&i][4]) > 0 And
            &funcInfo [&i][6] <> 0 Then
         Break;
      End-If;
      &i = &i + 1;
   End-While;
   
   If &i > &nFuncs Then
      LogText("not found");
      Return False;
   End-If;
   
   /* 2. Next get the info necessary to call the function based on the signature
 info */
   Local string &parSignatures = &funcInfo [&i][2];
   Local boolean &bPars = False;
   Local array of any &Pars;
   If Len(&parSignatures) > 0 Then
      &bPars = True;
      Local array of string &parSignature = Split(&parSignatures, ",");
      Local array of string &parNames = Split(&funcInfo [&i][4], ","); 
/* first one should be Create/get/? */
      /* number of parameters should match number of parameter names  */
      If &parSignature.Len <> &parNames.Len - 1 Then
         LogText("length mismatch");
         Return False;
      End-If;
      &Pars = SetupParameters(&parNames, &parSignature);
   Else
      &Pars = CreateArrayAny();
   End-If;

   /* 3. Call the udm method with our parameters */
   Return &ci.InvokeMethodUDF(&methodName, &Pars);
   
End-Function;

QE_ABSENCE_HIST.QE_REASON.Value = ""; /* clean it up */
Local string &ciName = "PROCESSREQUEST";

Local ApiObject &CI = CreateCI(&ciName);

Local array of any &pars = CreateArrayAny("First parameter", 2);
/* check with variable for method name */
Local string &methodname = "FoxTest";
/* add in a bogus parameter  - tested - works - fails with false return :-( as per usual in api objects*/
Local string &bogus = "bogus par";

&log = GetFile("C:\temp\junk\udflog.txt", "a", %FilePath_Absolute);
LogText("=====================================");
LogText("Result of direct call: " | &CI.InvokeMethodUDF(&methodname, &pars /* , &bogus */));
rem LogText("&ci: " | &CI);

/* do this the new way - at least model how a webservices Peoplecode implementation could do it */
Local string &ciObjid = "COMPONENTINTERFACE." | &ciName | ".METHOD.Methods";
/* get the program information */
Local array of array of any &progInfo;
&progInfo = GetProgramFunctionInfo(&ciObjid);
/* returns a an array of arrays: an array for each function defined in the program.

Each row has the following ([i] = position i):
[1] = program name (string)
[2] = comma separated list of parameter signatures (string)
[3] = result signature (string)
[4] = text that was with the doc tag. Convention here is a comma separated list of values:
    first item is one of either Create or Get, specifying what method has to be called first
    second and subsequent items are the names of the parameters (this information is not obtainable from the
    program information. These are the names to be exposed as the web service parameter names

    e.g. the above function would have a doc like "Create, StringParameter, NumericParameter"
[5] = an integer setting: 0=no export and 1=export (the default)
[6] = an integer setting indicating the permission for user to call this (only applies to CI programs)
		0=no permission and 1=permitted (the default)

*/
DisplayProgramFuncInfo(&progInfo);
If &CI = Null Then
   &CI = CreateCI(&ciName);
End-If;
LogText("Result of indirect call: " | CallUDMMethod(&CI, &progInfo, &methodname));

Syntax

GetPubContractInstance(pub_id, pub_nodename, channelname, sub_nodename)

Description

Note: This function is no longer available. It has been replaced with the GetPubXmlDoc function.

See GetPubXmlDoc.

Syntax

GetPubHeaderXmlDoc(PubID, PubNode, ChannelName, VersionName[, Segment])

Description

Use the GetPubHeaderXmlDoc function to retrieve the message header from the message queue.

Note: This function has been deprecated and remains for backward compatibility only. Use the IntBroker class GetMessage method instead.

The message header, also known as the message instance, is the published message before any transformations were performed.

Note: This function should not be used in standard message processing. It should only be used when correcting or debugging a publication contract that is in error.

Related Links

GetMessage

Parameters

Field or Control

Definition

PubID

Specify the PubID of the message.

PubNode

Specify the Pub Node Name of the message.

ChannelName

Specify the channel name of the message.

VersionName

Specify the version name of the message.

Segment

Specify an integer representing which segment you want to access. The default value is one, which means that if you do not specify a segment, the first segment is accessed.

Returns

A reference to an XmlDoc object if successful, NULL if not successful.

Syntax

GetPubXmlDoc(PubID, PubNode, ChannelName, VersionName, MessageName, SubNode [, Segment])

Description

Use the GetPubXmlDoc function to retrieve a message from the message queue.

Note: This function has been deprecated and remains for backward compatibility only. Use the IntBroker class GetMessage method instead.

This is the message after any transformations have been preformed. It creates and loads a data tree for the specified message version, and returns NULL if not successful. This function is used for publication contract error correction when the error correction process needs to fetch a particular message instance for the publication contract in error. SQL on the Publication Contract table is used to retrieve the key fields.

Note: This function should not be used in standard message processing. It should only be used when correcting or debugging a publication contract that is in error.

Related Links

GetMessage

Parameters

Field or Control

Definition

PubID

Specify the PubID of the message.

PubNode

Specify the Pub Node Name of the message.

ChannelName

Specify the channel name of the message.

VersionName

Specify the version name of the message.

MessageName

Specify the name of the message.

SubNode

Specify the subnode of the message.

Segment

Specify an integer representing which segment you want to access. The default value is one, which means that if you do not specify a segment, the first segment is accessed.

Returns

A reference to an XmlDoc object if successful, NULL if not successful.

Syntax

GetRatingBoxChart(RecordName.FieldName)

Description

Use the GetRatingBoxChart function to get a reference to an RatingBoxChart class object.

A chart must be associated with a record and field merely so that the chart object can be instantiated in PeopleCode. Which record and field you use doesn't matter. Commonly, the same derived/work record is used for all the charts in an application.

Parameters

Field or Control

Definition

RecordName.FieldName

Specify the record and field associated with the chart you want to get.

Returns

A reference to a RatingBoxChart object.

Example

&rbRatingBoxChart = GetRatingBoxChart(CHARTREC_WRK.CHART_FLD);

Syntax

GetRatingGauge(RecordName.FieldName)

Description

Use the GetRatingGauge function to get a reference to a RatingGaugeChart object.

A gauge must be associated with a record and field merely so that the gauge object can be instantiated in PeopleCode. While the record and field you use doesn't matter, for a rating gauge, the field must be either Numeric or Float. Commonly, the same derived/work record is used for all the charts in an application.

Parameters

Field or Control

Definition

RecordName.FieldName

Specify the record and field name associated with the rating gauge.

Note: For a rating gauge, the field must be either Numeric or Float.

Returns

A reference to a RatingGaugeChart object.

Example

&oRating = GetRatingGauge(QE_TRNMNT_SCR.CJY_RND_SCR);

Syntax

GetRatingGaugeState()

Description

Use the GetRatingGaugeState function to get a reference to a RatingGaugeState object. A RatingGaugeState object can then be associated with the corresponding state property on the RatingGaugeChart object.

Parameters

None.

Returns

A reference to a RatingGaugeState object.

Example

&oRatGaugeSelState = GetRatingGaugeState();
&oRatGaugeSelState.Shape = %RatingGauge_Circle;
&oRatGaugeSelState.Color = 3;
&oRatGaugeSelState.BorderColor = 10;

&oRating.SelectedState = &oRatGaugeSelState;

Syntax

GetRecord([Record.REC_NAME])

Description

Use the GetRecord function to create a reference to a record object for the current context, that is, from the row containing the currently executing program.

The following code:

&REC = GetRecord();

is equivalent to:

&REC = GetRow().GetRecord(Record.recname);

or

&REC = GetRow().recname;

Note: This function is invalid for PeopleCode programs located in events that aren't associated with a specific row and record at the point of execution. That is, you cannot use this function in PeopleCode programs on events associated with high-level objects like pages (the Activate event) or components (component events).

Parameters

With no parameters, this function returns a record object for the current context (the record containing the program that is running).

If a parameter is given, Record. REC_NAME must specify a record in the current row.

Returns

GetRecord returns a record object.

Example

In the following example, the level 2 rowset (scroll) has two records: EMPL_CHKLST_ITM, (the primary record) and CHKLST_ITM_TBL. If the code is running from a field on the EMPL_CHKLST_ITM record, the following returns a reference to that record:

&REC = GetRecord(); /*returns primary record */

The following returns the other record in the current row.

&REC2 = GetRecord(Record.CHKLST_ITM_TBL);

The following event uses the @ symbol to convert a record name that’s been passed in as a string to a component name.

Function set_sub_event_info(&REC As Record, &NAME As string) 
   &FLAGS = CreateRecord(RECORD.DR_LINE_FLG_SBR); 
   &REC.CopyFieldsTo(&FLAGS); 
   &INFO = GetRecord(@("Record." | &NAME)); 
   If All(&INFO) Then 
      &FLAGS.CopyFieldsTo(&INFO); 
   End-If; 
End-Function;

Syntax

GetReferenceArea()

Description

Use the GetReferenceArea function to get a reference to a ReferenceArea object. ReferenceArea instances can then be associated with a Chart object.

Parameters

None.

Returns

A reference to a ReferenceArea object.

Example

&MyRefArea = GetReferenceArea();

Syntax

GetReferenceLine()

Description

Use the GetReferenceLine function to get a reference to a ReferenceLine object. ReferenceLine instances can then be associated with a Chart object.

Parameters

None.

Returns

A reference to a ReferenceLine object.

Example

&MyRefLine = GetReferenceLine();

Syntax

GetRelField(ctrl_field, related_field) 

Description

Use the GetRelField function to retrieve the value of a related display field and returns it as an unspecified (Any) data type.

Note: This function remains for backward compatibility only. Use the GetRelated field class method instead.

The field ctrl_field specifies the display control field, and related_field specifies the name of the related display field whose value is to be retrieved. In most cases, you could get the value of the field by referencing it directly. However, there are two instances where GetRelField can be useful:

  • If there are two related display fields bound to the same record field, but controlled by different display control fields, use this function to specify which of the two related display fields you want.

  • If all of a page’s level-zero fields are search keys, the Component Processor does not load the entire row of level-zero data into the component buffer; it only loads the search keys. Adding a non-search-key level-zero field to the page would cause the Component Processor to load the entire row into the component buffer. To prevent a large row of data from being loaded into the buffer, you may occasionally want to make a level-zero display-only field a related display, even though the field is in the primary level-zero record. You won’t be able to reference this related display field directly, but you can using GetRelField.

See GetRelated.

Using GetRelField With a Control Field

PeopleCode events on the Control Field can be triggered by the Related Edit field. When this happens, there can be different behavior than with other types of fields:

  • If the events are called from FieldEdit of the Control Field, and that FieldEdit is triggered by a change in the Related Edit field, the functions return the previous value.

  • If the events are called from FieldChange of the Control Field, and that FieldChange is triggered by a change in the Related Edit field, the functions return the value entered into the Related Edit. This may be a partial value that will subsequently be expanded to a complete value when the processing is complete.

Example

In the following example, there are two related display fields in the page bound to PERSONAL_DATA.NAME. One is controlled by the EMPLID field of the high-level key, the other controlled by an editable DERIVED/WORK field in which the user can enter a new value. Use GetRelField to get the value of the related display controlled by EMPLID.

/* Use a related display of a required non-default field to verify 
 * that the new Employee Id is not already in use */
If GetRelField(EMPLID, PERSONAL_DATA.NAME) <> "" Then
   Error MsgGet(1000, 65, "New Employee ID is already in use.  Please reenter.");
End-If;

Syntax

GetRow()

Description

Use the GetRow function to obtain a row object for the current context, that is the row containing the currently executing program.

Using the GetRow function is equivalent to:

&ROW = GetRowset().GetRow(CurrentRowNumber());

Note: For PeopleCode programs located in events that are not associated with a specific row at the point of execution, this function is invalid. That is, you cannot use this function in PeopleCode programs on events associated with high-level objects like pages or components.

Parameters

None.

Returns

GetRow returns a row object that references the current row in the component buffers. If the program is not being run from a page (such as from Application Engine, or as part of a Message program) it references that data.

Example

Local Row &ROW;
&ROW = GetRow();

Syntax

GetRowset([SCROLL.scrollname])

Description

Use the GetRowset function to get a rowset object based on the current context. That is, the rowset is determined from the row containing the program that is running.

Syntax Format Considerations

An expression of the form

RECORD.scrollname.property

or

RECORD.scrollname.method(. . .)

is converted to an object expression by using GetRowset(SCROLL. scrollname).

Parameters

If a parameter is specified, it must be the name of the primary record for the scroll that is a child of the current context.

Returns

With no parameters, GetRowset returns a rowset object for the rowset containing the currently running program. If a parameter is specified, it returns a rowset for that child scroll. scrollname must be the name of the primary record for the scroll.

Example

In the following example, RS1 is a level 1 rowset, and RS2 is a child rowset of RS1.

Local Rowset &RS1, &RS2;
&RS1 = GetRowset(); 
&RS2 = GetRowset(SCROLL.EMPL_CHKLST_ITM);

Syntax

GetRowsetCache([Rowset.]name, [language])

Description

Use GetRowsetCache to return the existing rowset cache with the given name.

Note: This function returns a RowsetCache object, not a rowset object. You must use the Get RowsetCache method in order to convert a RowsetCache object into a rowset object.

Every time you use the GetRowsetCache function, you should verify that the function executed successfully by testing for a null object. For example:

Local RowsetCache &RSC;

&RSC = GetRowsetCache(Rowset.MyRowset);

If All(&RSC) Then
		/* do processing */
Else
		/* call to populate rowset cache */
End-if;

Parameters

Field or Control

Definition

Record. name

Specify the name of a RowsetCache. If you just specify name, you must enclose the name in quotation marks.

language

Specify which language the rowset cache is retrieved from.

Possible values are:

%RowsetCache_SignonLang – Fetch the rowset cache for the sign-on language. If it doesn't exist then return failure.

%RowsetCache_BaseLang – Fetch the rowset cache for the base language only. If it doesn't exist then return failure.

%RowsetCache_SignonOrBaseLang – Fetch the rowset cache for the sign-on language. If the rowset cache for the sign-on language doesn't exist then fetch the base language rowset cache. If the base language rowset cache doesn't exist then return failure.

This parameter is optional.

The default is %RowsetCache_SignonLang

Returns

A RowsetCache object populated with the rowset cache instance specified.

Example

&Cache1 = GetRowsetCache("AAROWSET1");

Syntax

GetSearchRecName()

Description

Use the GetSearchRecName function to return the search record name for the component.

Important! Use this function within fluid applications only.

Parameters

None.

Returns

A string value.

Example

&strRecName = GetSearchRecordName();

Syntax

GetSelectedTreeNode(RECORD.recordname)

Description

Use the GetSelectedTreeNode function to determine what node the user has selected in a dynamic tree control.

Note: Dynamic tree controls have been deprecated. Use the GenerateTree function or Tree Viewer.

Syntax

GetSeries()

Description

Use the GetSeries function to get a reference to a Series object. Series instances can then be associated with a Chart object.

Parameters

None.

Returns

A reference to a Series object.

Example

&series1 = GetSeries();

Syntax

GetSession()

Description

Use the GetSession function to retrieve a PeopleSoft session object.

After you use GetSession, you can instantiate many other types of objects, like Component Interfaces, data trees, and so on.

After you use GetSession you must connect to the system using the Connect property.

If you are connecting to the existing session and not doing additional error checking, you may want to use the %Session system variable instead of GetSession. %Session returns a connection to the existing session.

Parameters

None.

Returns

A PeopleSoft session object.

Example

Local ApiObject &MYSESSION; 
 
&MYSESSION = GetSession();

Syntax

GetSetId({FIELD.fieldname | text_fieldname}, set_ctrl_fieldvalue, {RECORD.recname | text_recname}, treename)

Description

Use the GetSetId function to return a string containing a setID based on a set control field (usually BUSINESS_UNIT), a set control value, and one of the following:

  • The name of a control table (or view) belonging to a record group in the TableSet Control controlled by the set control value.

  • The name of a tree in the TableSet Control controlled by the set control value.

If you want to pass a control record name to the function, you must pass an empty string in the treename parameter. Conversely, if you want to pass a tree name, you must pass an empty string in the text_recname parameter. In practice, tree names are rarely used in this function.

Note: This function does not validate the parameters passed to it. It is up to your application to ensure that only valid data is used. If an invalid value is used, the defined default value is used.

Parameters

Field or Control

Definition

fieldname

Specify the set control field name as a FIELD reference. Use this parameter (recommended) or the text_fieldname parameter.

text_fieldname

Specify the name of the set control field as a string. Use this parameter or the fieldname parameter.

set_ctrl_fieldvalue

Specify the value of the set control field as a string.

recname

Specify as a RECORD reference the name of the control record belonging to the record group for which you want to obtain the setID corresponding to the set control value. Use this parameter (recommended) or the text_recname parameter.

text_recname

Specify as a string the name of the control record belonging to the record group for which you want to obtain the setID corresponding to the set control field value. Use this parameter or the recname parameter.

treename

Specify as a string the name of the tree for which you want to obtain the setID corresponding to the set control field value.

Returns

GetSetId returns a five-character setID string.

Example

In this example, BUSINESS_UNIT is the Set Control Field, and PAY_TRMS_TBL is a control table belonging to a record group controlled by the current value of BUSINESS_UNIT. The function returns the setID for the record group.

&SETID = GetSetId(FIELD.BUSINESS_UNIT, &SET_CTRL_VAL, RECORD.PAY_TRMS_TBL, "");

Syntax

GetSparkChart(RecordName.FieldName)

Description

Use the GetSparkChart function to return a reference to a SparkChart object.

A spark chart must be associated with a record and field merely so that the spark chart object can be instantiated in PeopleCode. Which record and field you use doesn't matter. Commonly, the same derived/work record is used for all the charts in an application.

Parameters

Field or Control

Definition

RecordName.FieldName

Specify the record and field name associated with the spark chart.

Returns

A reference to a SparkChart object.

Example

&aS = GetSparkChart(QE_DVTSCR_WRK.QE_CHRT1);

Syntax

GetSparkChartItem()

Description

Use the GetSparkChartItem function to return a reference to a SparkChartItem object.

Parameters

None.

Returns

A reference to a SparkChartItem object.

Example

&aS1 = GetSparkChartItem();

Syntax

GetSQL(SQL.sqlname [, paramlist])

Where paramlist is an arbitrary-length list of values in the form:

inval1 [, inval2] ...

Description

Use the GetSQL function to instantiate a SQL object and associates it with the SQL definition specified by sqlname. The SQL definition must already exist, either created using Application Designer or the StoreSQL function.

Processing of the SQL definition is the same as for a SQL statement created by the CreateSQL function.

Setting Data Fields to Null

This function does not set Component Processor data buffer fields to NULL after a row not found fetching error. However, it does set fields that aren’t part of the Component Processor data buffers to NULL.

Using Arrays With paramlist

You can use a parameter of type "Array of Any" in place of a list of bind values. This is primarily used when you do not know the number of values being supplied until the code runs.

For example, suppose you had a SQL definition INSERT_TEST, that had PeopleCode that dynamically (that is, at runtime) generated the following SQL statement:

"INSERT INTO PS_TESTREC (TESTF1, TESTF2, TESTF3, TESTF4, . . .TESTN) VALUES (:1, :2, %DateTimeIn(:3), %TextIn(:4). . .N)";

Suppose you have placed the values to be inserted into an Array of Any, say &AAny:

&AAny = CreateArrayAny("a", 1, %DateTime, "abcdefg", . . .N);

You can execute the insert by:

GetSQL(SQL.INSERT_TEST, &AAny);

Because the Array of Any promotes to absorb any remaining select columns, it must be the last parameter for the SQL object Fetch method or (for results) SQLExec. For binding, it must be the only bind parameter, as it is expected to supply all the bind values needed.

Parameters

Field or Control

Definition

SQL.sqlname

Specify the name of a SQL definition.

paramlist

Specify input values for the SQL string.

Returns

A SQL object.

Example

The following code creates and opens an SQL object on the SQL definition stored as ABCD_XY (for the current market, database type and as of date). It binds the given input values, and executes the statement. If the SQL.ABCD is a SELECT, this should be followed by a series of Fetch method calls.

&SQL = GetSQL(SQL.ABCD_XY, ABSENCE_HIST, &EMPLID);

The following is a generic function that can be called from multiple places to retrieve a specific record using the SQL Objects.

Local SQL &SQL; 
Local string &SETID, &TEMPLATE; 
Local date &EFFDT; 
 
Function FTP_GET_TEMPLATE(&REC As Record) Returns Boolean ; 
   &TEMPLATE = FTP_RULE_TEMPLATE; 
   &EFFDT = EFFDT; 
   &SETID = SETID; 
   &SQL = GetSQL(SQL.FTP_TEMPLATE_SELECT, &SETID, &TEMPLATE, &EFFDT); 
   If &SQL.Status = 0 Then 
      If &SQL.Fetch(&REC) Then 
         &SQL.Close(); 
         Return True; 
      End-If; 
   Else 
      &TITLE = MsgGet(10640, 24, "SQL Error"); 
      MessageBox(64, &TITLE, 10640, 23, "SQL Object Not Found in SQL", SQL.FTP_TEMPLATE_SELECT); 
   End-If; 
   &SQL.Close(); 
   Return False; 
End-Function;

The SQL definition FTP_TEMPLATE_SELECT has the following code. Note that it uses the %List and %EFFDTCHECK meta-SQL statements. This makes the code easier to maintain: if there are any changes to the underlying record structure, this SQL definition won’t have to change:

SELECT %List(FIELD_LIST,FTP_DEFAULT_TBL A)   
FROM PS_FTP_TEMPLATE_TBL A   
WHERE A.SETID = :1  AND A.FTP_RULE_TEMPLATE = :2   
AND %EFFDTCHECK(FTP_DEFAULT_TBL A1,A,:3)  AND A.EFF_STATUS = 'A' 

Syntax

GetStatusMeterGauge(RecordName.FieldName)

Description

Use the GetStatusMeterGauge function to get a reference to a StatusMeterGauge object.

A gauge must be associated with a record and field merely so that the gauge object can be instantiated in PeopleCode. Which record and field you use doesn't matter. Commonly, the same derived/work record is used for all the charts in an application.

Parameters

Field or Control

Definition

RecordName.FieldName

Specify the record and field name associated with the status meter gauge.

Returns

A reference to a StatusMeterGauge object.

Example

&MyGauge = GetStatusMeterGauge(GAUGEREC_WRK.GAUGE_FLD);

Syntax

GetStoredFormat(scrollpath, target_row, [recordname.]fieldname)

where scrollpath is:

[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ]] RECORD.target_recname

To prevent ambiguous references, you can also use SCROLL.scrollname, where scrollname is the same as the scroll level’s primary record name.

Description

Use the GetStoredFormat function to return the name of a field’s custom stored format.

Note: This function remains for backward compatibility only. Use the StoredFormat field class property instead.

To return the format for a field on level zero of the page, pass 1 in target_row.

Parameters

Field or Control

Definition

scrollpath

A construction that specifies a scroll level in the component buffer.

target_row

An integer specifying the row of the target field. If you are testing a field on level zero, pass 1 in this parameter.

[recordname .]fieldname

The name of the field from which to get the stored format name. The field can be on any level of the active page. The recordname prefix is required if the call to GetStoredFormat is not on the record definition recordname.

Returns

Returns a String equal to the name of the stored custom format for the field.

Example

This example returns a string containing the custom format for postal codes on level zero of the page or on the current row of scroll level one. This function is called in the RowInit event, so no looping is necessary.

Function get_postal_format() Returns string
   &CURR_LEVEL = CurrentLevelNumber();
   Evaluate &CURR_LEVEL
   When = 0
      &FORMAT = GetStoredFormat(POSTAL, 1);
   When = 1
      &FORMAT = GetStoredFormat(POSTAL, CurrentRowNumber(1));
   End-Evaluate;
   Return (&FORMAT);
End-Function;

Syntax

GetSubContractInstance(pub_id, pub_nodename, channelname, messagename, sub_name)

Description

Note: This function is no longer available. It has been replaced with the GetSubXmlDoc function.

See GetSubXmlDoc.

Syntax

GetSubXmlDoc(PubID, PubNode, ChannelName, VersionName, MessageName[, Segment])

Description

Use the GetSubXmlDoc function to retrieve a message from the message queue.

Note: This function has been deprecated and remains for backward compatibility only. Use the IntBroker class GetMessage method instead.

It creates and loads a data tree for the specified message version, and returns NULL if not successful. This function is used for subscription contract error correction, when the error correction process needs to fetch a particular message instance for the subscription contract in error. SQL on the Subscription Contract table is used to retrieve the key fields.

Note: This function should not be used in standard message processing. It should only be used when correcting or debugging a subscription contract that is in error.

Related Links

GetMessage

Parameters

Field or Control

Definition

PubID

Specify the PubID of the message.

PubNode

Specify the Pub Node Name of the message.

ChannelName

Specify the channel name of the message.

VersionName

Specify the version name of the message.

MessageName

Specify the name of the message.

Segment

Specify an integer representing which segment you want to access. The default value is one, which means that if you do not specify a segment, the first segment is accessed.

Returns

A reference to an XmlDoc object if successful, NULL if not successful.

Syntax

GetSyncLogData(GUID, pubnode, chnlname, msg_name, logtype [, message_version])

Description

Use the GetSyncLogData to return a log containing information about the specified synchronous message.

Note: This function has been deprecated and remains for backward compatibility only. Use the IntBroker class GetSyncLogData method instead.

You can use this information for debugging. Using this function, you can obtain the request and response data in a synchronous request, both pre- and post-transformation.

This function is used in the PeopleCode for the Message Monitor.

Related Links

GetSyncLogData

Parameters

Field or Control

Definition

GUID

Specify the GUID for the published synchronous message as a string. This property is populated after the message is sent.

pubnode

Specify the name of the node that the synchronous message was published from as a string.

chnlname

Specify the name of the channel the synchronous message was published to as a string.

msg_name

Specify the message definition name that you want to retrieve log data from as a string.

Log_type

Specify the type of log data you want to obtain, as a number. Values are:

1: the original request

2: the transformed request

3: the original response

4: the transformed response

message_version

Specify the message version name as a string.

Returns

An XML string containing the log data.

Example

Local String &guid, &pubnode, &channel, &msg_name; 
Local Number &log_type;  
.. 
.. 
&descrlong = GetSyncLogData(&guid, &pubnode, &channel, &msg_name, &log_type);

Syntax

GetTempFile(filename, mode  [, charset] [, pathtype])

Description

The GetTempFile function provides an alternative to GetFile. Similar to GetFile, use the GetTempFile function to instantiate a new file object from the File class, associate it with an external file, and open the file so you can use File class methods to read from or write to it.

GetTempFile differs from GetFile in two respects: \

  • GetTempFile does not perform an implicit commit.

  • GetTempFile does not make the associated file available through the Report Repository even when the calling PeopleCode program is run through the Process Scheduler.

Therefore, GetTempFile can be a good choice when you wish to avoid implicit database commits and when you do not need to have the file managed through the Report Repository. Otherwise, GetTempFile operates exactly the same as GetFile. For additional information about GetTempFile, see the documentation on GetFile.

See GetFile.

Parameters

Field or Control

Definition

filespec

Specify the name, and optionally, the path, of the file you want to open.

mode

A string indicating how you want to access the file. The mode can be one of the following:

"R" (Read mode): opens the file for reading, starting at the beginning.

"W" (Write mode): opens the file for writing.

Warning! When you specify Write mode, any existing content in the file is discarded.

"A" (Append mode): opens the file for writing, starting at the end. Any existing content is retained.

"U" (Update mode): opens the file for reading or writing, starting at the beginning of the file. Any existing content is retained. Use this mode and the GetPosition and SetPosition methods to maintain checkpoints of the current read/write position in the file.

In Update mode, any write operation clears the file of all data that follows the position you set.

Note: Currently, the effect of the Update mode and the GetPosition and SetPosition methods is not well defined for Unicode files. Use the Update mode only on files stored with a non-Unicode character set.

"E" (Conditional "exist" read mode): opens the file for reading only if it exists, starting at the beginning. If it doesn’t exist, the Open method has no effect. Before attempting to read from the file, use the IsOpen property to confirm that it’s open.

"N" (Conditional "new" write mode): opens the file for writing, only if it doesn’t already exist. If a file by the same name already exists, the Open method has no effect. Before attempting to write to the file, use the IsOpen property to confirm that it’s open. You can insert an asterisk (*) in the file name to ensure that a new file is created. The system replaces the asterisk with numbers starting at 1 and incrementing by 1, and checks for the existence of a file by each resulting name in turn. It uses the first name for which a file doesn’t exist. In this way you can generate a set of automatically numbered files. If you insert more than one asterisk, all but the first one are discarded.

charset

A string indicating the character set you expect when you read the file, or the character set you want to use when you write to the file. You can abbreviate Unicode UCS-2 to "U" and the host operating system's default non-Unicode (sometimes referred to as the ANSI character set) to “A”. All other character sets must be spelled out in full, for example, ASCII, Big5, Shift-JIS, UTF8, or UTF8BOM.

If “A” is specified as the character set, or you do not specify a character set, the character set used is dependent on the application server configuration. On a Windows application server, the default non-Unicode character set is dependent on the Windows ANSI Codepage (ACP) which can be checked using the DOS command chcp. On a Unix application server, the default non-Unicode character set is specified in the application server configuration file, psappsrv.cfg, and can be modified using PSADMIN. You can also use a record field value to specify the character set (for example, RECORD.CHARSET.)

A list of supported character set names valid for this argument can be found in PeopleTools: Global Technology.

See Character Sets Across the Tiers of the PeopleSoft Architecture.

Note: If you attempt to read data from a file using a different character set than was used to write that data to the file, the methods used generate a runtime error or the data returned is unusable.

When a file is opened for reading using the “U” charset argument, GetFile expects the file to begin with a Unicode byte order mark (BOM). This mark indicates whether the file is written in big endian order or little endian order. A BOM consisting of the hex value 0xFEFF indicates a big endian file, a BOM consisting of the hex value 0xFFEF indicates a little endian file. If the Unicode UCS-2 file being opened does not start with a BOM, an error is returned. The BOM is automatically stripped from the file when it is read into the buffers by GetFile.

When a file is opened for writing using the “U” charset argument, the appropriate Unicode BOM is automatically written to the start of the file depending on whether the application server hardware platform operates in little endian or big endian mode.

BOMs are only expected or supported for files in Unicode character sets such as UTF8, UTF8BOM, and UCS2. For consuming applications that do expect the BOM for UTF-8 files, the UTF8BOM character set is to create UTF-8 files with the BOM.

Note: For example, the UTF-8 BOM is represented by the sequence 0xEF BB BF. This sequence can be misinterpreted by a non-Unicode character set such as ISO-8859-1 and appears as ISO characters .

When working with XML documents, specify UTF8 or UTF8BOM for charset.

If you are writing an XML file using a different character set, you must remember to include a character set declaration in the XML file.

pathtype

If you have prepended a path to the file name, use this parameter to specify whether the path is an absolute or relative path. The valid values for this parameter are:

  • %FilePath_Relative (default)

  • %FilePath_Absolute

If you don’t specify pathtype the default is %FilePath_Relative.

If you specify a relative path, that path is appended to the path constructed from a system-chosen environment variable. A complete discussion of relative paths and environment variables is provided in documentation on the File class.

See Working With Relative Paths.

If the path is an absolute path, whatever path you specify is used verbatim. You must specify a drive letter and the complete path. You can’t use any wildcards when specifying a path.

The Component Processor automatically converts platform-specific separator characters to the appropriate form for where your PeopleCode program is executing. On a Windows system, UNIX "/" separators are converted to "\", and on a UNIX system, Windows "\" separators are converted to "/".

Note: The syntax of the file path does not depend on the file system of the platform where the file is actually stored; it depends only on the platform where your PeopleCode is executing.

Returns

A file object if successful; Null otherwise.

Syntax

GetThreshold()

Description

Use the GetThreshold function to get a reference to a Threshold object. Threshold instances can then be associated with gauge instances.

Parameters

None.

Returns

A reference to a Threshold object.

Example

&MyThreshold = GetThreshold();

Syntax

GetToolTip()

Description

Use the GetToolTip function to get a reference to a TooltipLabel object. TooltipLabel instances can then be associated with a Chart object.

Parameters

None.

Returns

A reference to a TooltipLabel object.

Example

&label1 = GetToolTip();

Syntax

GetTreeNodeParent(node)

Description

Use the GetTreeNodeParent function to access data from dynamic tree controls.

Note: Dynamic tree controls have been deprecated. Use the GenerateTree function or Tree Viewer.

Syntax

GetTreeNodeRecordName(node)

Description

Use the GetTreeNodeRecordName function in accessing data from dynamic tree controls.

Note: Dynamic tree controls have been deprecated. Use the GenerateTree function or Tree Viewer.

Syntax

GetTreeNodeValue(node, [recordname.]fieldname)

Description

Use the GetTreeNodeValue function in accessing data from dynamic tree controls.

Note: Dynamic tree controls have been deprecated. Use the GenerateTree function or Tree Viewer.

Syntax

GetURL(URL.URLIdentifier)

Description

Use the GetURL function to return the URL, as a string, for the specified URLIdentifier. The URLIdentifier must exist and been created using URL Maintenance.

Note: If the URL identifier contains spaces, you must use quotation marks around URLIdentifier. For example, GetURL(URL."My URL");

If a language-specific URL exists for the user's current session language, and the user is not calling GetURL from a batch program, it is returned. Otherwise, the base language version of the URL is returned.

When GetURL is called from an application engine program, the URL is retrieved either from the base URL table or the related language table depending on the language code. The language code is provided by the User Profile for the user that executed the application engine program. The language code does not come from the language that the user specified when logging into the system.

Parameters

Field or Control

Definition

URLIdentifier

Specify a URL Identifier for a URL that already exists and was created using the URL Maintenance page.

Returns

A string containing the URL value for that URL Identifier, using the user's language preference.

Example

Suppose you have a URL with the identifier PEOPLESOFT, and the following URL:

http://www.example.com

From the following code example

&PS_URL = GetURL(URL.PEOPLESOFT);

&PS_URL has the following value:

http://www.example.com

Suppose you have the following URL stored in the URL Maintenance, with the name QE_CALL:

/S/WEBLIB_QE_MCD.QE_MCD_MAIN.FieldFormula.iScript_Call

You could combine this in the following code to produce an HTML string used as part of a response:

&output = GetHTMLText(HTML.QE_PHONELIST, %Request.RequestURI | "?" | 
GetURL(URL.QE_CALL));

Syntax

GetUserOption(Level, OPTN)

Description

Use the GetUserOption function to return the default value for the specified option.

Parameters

Field or Control

Definition

Level

Specify the option category level as a string.

OPTN

Specify the option as a string.

Returns

The default value for the specified option.

Example

Local Any &MyValue;
&MyValue = GetUserOption("PPLT", "TZONE");

Syntax

GetWLFieldValue(fieldname) 

Description

When the user has opened a page from a Worklist (by selecting one of the work items) use the GetWLFieldValue function to retrieve the value of a field from the current row of the application Worklist record. You can use the %WLName system variable to check whether the page was accessed from a Worklist.

Returns

Returns the value of a specified field in the Worklist record as an Any data type.

Example

This example, from RowInit PeopleCode, populates page fields with values from the Worklist record. The %WLName system variable is used to determine whether there is a currently active Worklist (that is, whether the user accessed the page using a Worklist).

&WL = %WLName;
If &WL > " " Then
   &TEMP_NAME = "ORDER_NO";
   ORDER_NO = GetWLFieldValue(&TEMP_NAME);
   &TEMP_NAME = "BUSINESS_UNIT";
   BUSINESS_UNIT = GetWLFieldValue(&TEMP_NAME);
   &TEMP_NAME = "SCHED_Date";
   &SCHED_Date = GetWLFieldValue(&TEMP_NAME);
   SCHED_Date = &SCHED_Date;
   &TEMP_NAME = "DEMAND_STATUS";
   DEMAND_STATUS = GetWLFieldValue(&TEMP_NAME);
End-If;

Syntax

Global data_type &var_name

Description

Use the Global statement to declare PeopleCode global variables. A global variable, once declared in any PeopleCode program, remains in scope throughout the PeopleSoft session. The variable must be declared with the Global statement in any PeopleCode program in which it is used.

Declarations tend to appear at the beginning of the program, intermixed with function declarations.

Not all PeopleCode data types can be declared as Global. For example, ApiObject data types can only be declared as Local.

Parameters

Field or Control

Definition

data_type

Specify a PeopleCode data type.

&var_name

A legal variable name.

Example

The following example declares a global variable and then assigns it the value of a field:

Global string &ID; 
&ID = AE_APPL_ID;

Syntax

Gray(scrollpath, target_row, [recordname.]fieldname)

where scrollpath is:

[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ]] RECORD.target_recname

To prevent ambiguous references, you can also use SCROLL. scrollname, where scrollname is the same as the scroll level’s primary record name.

If you put the function on the same scroll level as the field being changed, you can use the following syntax:

Gray(Fieldname)

The more complex syntax can be used to loop through a scroll on a lower level than the PeopleCode program.

Description

Use the Gray function to make a field unavailable for entry a page field, preventing the user from making changes to the field.

Note: This function remains for backward compatibility only. Use the Enabled field class property instead.

Gray makes a field display-only, while Hide makes it invisible. You can undo these effects using the built-in functions Ungray and Unhide.

Note: If you specify a field as Display Only in Application Designer, using the PeopleCode functions Gray, followed by Ungray, will not make it editable. This function shouldn't be used in any event prior to RowInit.

Parameters

Field or Control

Definition

scrollpath

A construction that specifies a scroll level in the component buffer.

target_row

An integer specifying the row on the target scroll level where the referenced buffer field is located.

[recordname .]fieldname

The name of the field to gray. The field can be on scroll level one, two, or three of the active page. The recordname prefix is required if the call to Gray is not on the record definition recordname.

Returns

Optionally returns a Boolean value indicating whether the function succeeded.

Example

This example, which would typically be found in the RowInit event, disables the page’s address fields if the value of the SAME_ADDRESS_EMPL field is "Y".

If SAME_ADDRESS_EMPL = "Y" Then
   Gray(STREET1);
   Gray(STREET2);
   Gray(CITY);
   Gray(STATE);
   Gray(ZIP);
   Gray(COUNTRY);
   Gray(HOME_PHONE);
End-if;

Syntax

GrayMenuItem(BARNAME.menubar_name, ITEMNAME.menuitem_name)

Description

Note: The GrayMenuItem function is supported for compatibility with previous releases of PeopleTools. New applications should use DisableMenuItem instead.

Related Links

DisableMenuItem

Syntax

GroupletRequestSource()

Description

Use the GroupletRequestSource function to return an Integer value indicating the source page (location) for the grouplet.

Important! Use this function within fluid applications only.

Parameters

None.

Returns

One of the following Integer values:

Numeric Value

Constant Value

Description

-1

%GroupletSourceMain

The main, or primary fluid page.

0

%GroupletSourceHeader

The page displayed in the <header> section of the HTML acting as the banner area fixed at the top of every page within the fluid component.

1

%GroupletSourceSide1

The left panel (page of type Side Page 1).

2

%GroupletSourceSide2

The right panel (page of type Side Page 2).

3

%GroupletSourceFooter

The page displayed in the <footer> section of the HTML at the bottom of every page within the fluid component.

Example

Evaluate GroupletRequestSource()
When = %GroupletSourceMain
   /* Some processing */
   Break;
When-Other
   /* Some processing */
   Break;
End-Evaluate;