PeopleSoft HTML Element IDs

The HTML element IDs that appear on PeopleSoft pages follow an officially undocumented naming convention.  It would be nice to know the exact naming convention that is being used on these HTML element IDs so that there would be no uncertainty when it comes to DOM manipulation with injected client side code.  Fortunately, there have been many PeopleSoft experts in the past that have demonstrated how the HTML element IDs on PeopleSoft pages typically have their record and field names present in the ID.  It is worth noting that not all fields follow the RECORDNAME_FIELDNAME naming convention.  This is true for fields that have a value set for the page field name in the page field properties in App Designer.  An example of this would be the National ID field that appears on the relationships page.

Relationships_Page

Inspecting the HTML element of this field shows an ID of SA_MASK_NID2.

National_ID_Element

However, the actual field name is NATIONAL_ID and the record name is PERS_NID_PRM_VW.

Page_Field_Properties

The SA_MASK_NID2 value that is used as the element ID for this field is specified under the general tab in the page field properties as the page field name.

Page_Field_Name

So it seems that if a field has a value for the page field name, then PeopleSoft uses this value as the HTML element ID, otherwise the record and field name will be used.  If this assumption is true, then the PeopleSoft meta-data tables can be used to determine what the HTML element ID will be for any given field name.  Below is a query that can be used for this purpose.

SELECT DISTINCT TB2.PNLGRPNAME AS COMPONENT 
 , TB1.PNLNAME AS PAGE 
 , TB1.RECNAME AS RECORD
 , TB1.FIELDNAME AS FIELD 
 , NVL(TRIM(TB1.PNLFIELDNAME), TRIM(TB1.RECNAME || '_' || TB1.FIELDNAME)) AS ELEMENT_ID 
 FROM PSPNLFIELD TB1, PSPNLGROUP TB2 
 WHERE TB1.PNLNAME = TB2.PNLNAME
 AND TB1.FIELDNAME = 'NATIONAL_ID' -- put field name here
 --AND TB1.RECNAME = 'PERS_NID_PRM_VW' -- put record name here
 --AND TB1.PNLNAME = 'RELATIONSHIPS' -- put page name here
 --AND TB2.PNLGRPNAME = 'RELATIONSHIPS' -- put component name here
 UNION 
 SELECT DISTINCT TB3.PNLGRPNAME AS COMPONENT 
 , TB2.PNLNAME AS PAGE 
 , TB1.RECNAME AS RECORD
 , TB1.FIELDNAME AS FIELD 
 , NVL(TRIM(TB1.PNLFIELDNAME), TRIM(TB1.RECNAME || '_' || TB1.FIELDNAME)) AS ELEMENT_ID 
 FROM PSPNLFIELD TB1, PSPNLFIELD TB2 , PSPNLGROUP TB3 
 WHERE TB1.PNLNAME = TB2.SUBPNLNAME 
 AND TB2.FIELDTYPE = '11'
 AND TB2.PNLNAME = TB3.PNLNAME 
 AND TB1.FIELDNAME = 'NATIONAL_ID' -- put field name here
 --AND TB1.RECNAME = 'PERS_NID_PRM_VW' -- put record name here
 --AND TB2.PNLNAME = 'RELATIONSHIPS' -- put page name here
 --AND TB3.PNLGRPNAME = 'RELATIONSHIPS' -- put component name here

This query plays a big role in the configurable interface of my field-level data masking solution. Hopefully the PeopleSoft HTML element ID naming convention stays consistent in the future.

Leave a comment

Your email address will not be published. Required fields are marked *

Loading...