A function is a named section of a program that performs a specific task that can be reused. The main advantages of functions are resusability and ease of maintainance.
1. Builtin functions
2. Internal peoplecode functions
3. External peoplecode functions
4. External non peoplecode functions
PeopleTools provides a number of system variables that provide access to system information. System variables in peoplecode are prefixed with the ‘%’ character, rather than the ‘&’ character. You can use these system variables wherever you can use a constant, passing them as parameters to functions or assigning their values to fields or to temporary variables.
Variables are storage places for text or numbers that you define and manipulate. In peoplecode, each variable type starts with special character.
The scope of a variable is the part of the program over which the variable name can be referenced.
The RowDelete event is initiated whenever a user attempts to delete a row of data from a page scroll area. Use RowDelete PeopleCode to prevent the deletion of a row (using an Error or Warning statement) or to perform any other processing contingent on row deletion.For example, you could have a page field called Total on scroll area level zero whose value is the sum of all the Extension page fields on scroll area level one. If the user deleted a row on scroll area level one, you could use RowDelete PeopleCode to recalculate the value of the Total field.
Please go through the article below to understand What is a WORKFLOW , how to design and prepare workflows quickly with a simple example. Further, some enhancements and alternatives are also mentioned to better utilize the power of workflows. The paper would be found useful by a PeopleSoft Functional too to gain insights into the general logic and mapping of workflows.
The SaveEdit event is intiated whenever a user attempts to save the component. You can use SaveEdit PeopleCode to validate the consistency of data in component fields. Whenever a validation involves more than one component field, you should use SaveEdit PeopleCode.
The FieldChange event is triggered when is field is changed. Use FieldChange PeopleCode to recalculate page field values, change the appearance of page controls, or perform other processing that results from a field change other than data validation. To validate the contents of the field, use the FieldEdit event.
The RowInit event is initiated the first time that the Component Processor encounters a row of data. This occurs during component build processing and row insert processing. It also occurs after a Select or SelectAll Rowset method, or a ScrollSelect or related function, is executed.
PreBuild fires before any peoplecode code event on all the rows and fields in the component such as FieldDefault and RowInit. During the PreBuild event there will not be any data in the component buffer structure other than the search record as it’s executing prior to the component build process.
The SearchInit event is generated just before a search, add, or data-entry dialog box is displayed. SearchInit triggers associated PeopleCode in the search key fields of the search record. This allows you programmatically set values of search daialog fields. For example, if you want allow entry of search field for a user and display default values for other users you could write the below