On-line processing of data within PeopleSoft is controlled and managed by the Application Processor. PeopleCode programs are used to interact with this Application Processor to enhance and better control processing within a given panel or panel group. PeopleCode allows you to do such things as set default values on a panel upon panel entry, execute SQL statements to update the database, or conditionally change a panel based upon your own criteria.
PeopleCode programs are stored on the Data Designer and are associated with a specific field.For any field on a record, you may specify FieldDefault, FieldEdit, FieldChange, FieldFormula,RowInit, RowInsert, RowDelete, RowSelect, SaveEdit, SavePreChg, SavePostChg, SearchInit,SearchSave, and Workflow type programs. Each type of PeopleCode program executes at a different time within the processing flow of a panel or panel group. For more detailed information about PeopleCode types and programming, consult PeopleSoft's PeopleCode Guide.
UHS may require unique records/panels for which additional PeopleCode programs will need to be written. In order to differentiate changed and new programs from the delivered programs, a comment standard (see below) must be used when any existing PeopleCode programs are changed or new programs are written. For future upgrades, this will facilitate differentiating FlightPeopleCode from the vanilla PeopleCode that was delivered with the new release.
Each time a developer changes PeopleCode or creates new PeopleCode programs, this comment standard MUST be used. Reference the bold type in the following example.
/* UHS - MM/DD/YYYY – NAME (LAN ID) */
(UHS must be in uppercase letters and included in EVERY PeopleCode modification.)
/* Description of the change being made - as many */
/* lines of description as needed. Please reference */
/* the PS Fix # or Customization # . */
New line(s)of code
/* END */
Additional PeopleCode Standards include:
Do not change vanilla code; rather, comment out the original and add new lines with the change(s). This allows for a developer to see exactly what was changed from the original.
Check the value of the %panel or %panelgroup global variables to control execution of PeopleCode programs on various panels.
If one field from a record (except for Related Display fields like Descrs) appears on a panel, all of the Row Level PeopleCode programs will execute.
Restrict the use of field level PeopleCode as it hinders on-line performance.
Any messages required through PeopleCode should not reference existing PeopleSoft Message Set numbers. Use Message Set numbers between 20000 and 29000 to add custom messages to the Message Set Catalog under the Utilities Menu. Individual messages within range can be sequentially assigned.
To cut PeopleCode within the PeopleCode editor, use CTRL-X or use the Cut command button.
To copy PeopleCode within the PeopleCode editor, use CTRL-C or use the Copy command button.
To paste PeopleCode within the PeopleCode editor, use CTRL-V or use the Paste command button.
Determine whether anyone is making a change to the record you will be working on. If so, coordinate efforts.
When making PeopleCode changes, if PeopleCode does not work, don’t leave for the day with an error. Temporarily remark out code until you can start working on it again.
Document change within the PeopleCode per UHS Naming Conventions.
NEVER add new functions to the PeopleSoft function libraries:
where XXXX is a PeopleSoft functional extension (i.e. BEN, HR, PAY)
Create new derived records and function libraries for NEW derived fields and functions, e.g.
Use functions--whenever possible—for code that is performed in more than one place to ensure consistent processing and ease of maintenance.