0% found this document useful (0 votes)
12 views12 pages

People Code

People Code is a 4GL language used in PeopleSoft applications to manage complex application logic through event-driven programming. Key components include event flow, component buffers, and built-in functions, with specific events like SearchInit, RowSelect, and SaveEdit controlling various stages of data processing. Understanding the execution priority and the purpose of each event is crucial for effective People Code development.

Uploaded by

E-Box
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views12 pages

People Code

People Code is a 4GL language used in PeopleSoft applications to manage complex application logic through event-driven programming. Key components include event flow, component buffers, and built-in functions, with specific events like SearchInit, RowSelect, and SaveEdit controlling various stages of data processing. Understanding the execution priority and the purpose of each event is crucial for effective People Code development.

Uploaded by

E-Box
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

1- People Code – Preface

People Code is the 4GL Language with rich syntax to incorporate complex
application logic. PeopleSoft uses events to control the flow and functionality of
the application

Some of the important aspects to understand about people code are

 People code Event flow


 Component buffer
 Referencing data in a component buffer
 Important aspects of People code language
 People code in built functions

1.1 People Code Event Flow

People Code Event Flow in the following Scenarios

1.%2%.%3%) 1.1.1) Search Mode


2.%2%.%3%) 1.1.2) Add Mode
3.%2%.%3%) 1.1.3) Row Insert
4.%2%.%3%) 1.1.4) Row Delete
5.%2%.%3%) 1.1.5) Save processing
6.%2%.%3%) 1.1.1) Search Mode

SearchInit SearchSave RowselectPreBuidField Default 

FieldFormulaRowInitPostBuildPageActivateWaiting for User Actions

7.%2%.%3%) 1.1.2) Add Mode


8.%2%.%3%)
9.%2%.%3%) FieldDefaultFieldFormulaRowInitSearchInit->
FieldEditFieldChangeSearch Save -> Search Key Buffered

10.%2%.%3%) 1.1.3) Row Insert

RowInsert FieldDefaultFieldFormula->RowInit
PageActivateWaiting for User Actions

11.%2%.%3%) 1.1.4) Row Delete

RowDelete FieldDefaultFieldFormula->RowInit
PageActivateWaiting for User Actions
People Code Events Categories

Record People Code Events Component Record Events Component Record Events

1) SearchInit 1) RowSelect 1) PreBuild


2) SearchSave 2) RowInit 2) PostBuild
3) RowSelect 3) RowInsert 3) SavePreChange
4) FieldDefault 4) RowDelete 4) WorkFlow
5) FieldFormula 5) SaveEdit 5) SavePostChange
6) RowInit 6) SavePreChange
7) FieldEdit 7) SavePostChange
8) FieldChange 8) SearchInit
9) RowInsert 9) SearchSave
10) RowDelete
11) Save Edit
12) SavePreChange
13) WorkFlow
14) SavePostChange

Component Record Field Events

1) FieldDefault
2) FieldEdit
3) FieldChange
4) PrePopup

Execution Priority

Record People Code Events > Component Record Field Events >Component Record Events >
Component Record Field Events
2- People Code Events - In Details

Search Init

 Search init is triggered before the search Box is displayed.

 It provides way to Control processing before search Box is Displayed

 People Code is triggered only if it is attached to the search keys and alternated
Search Keys

 A warning/Error – Makes the component to be cancelled.

 In 8.4 there are 2 new searches at the record level

Search Edit- enforces required field and table edit on search Page without any
people Code and will enforce even if using setsearchdialogbehavior ().

Disable advanced search- prevents run time search pages from displaying
advanced search features

Function used in this Event Description

 Use the Setsearchdialogbehavior function in


Setsearchdialogbehavior(force_or_skip) SearchInit People Code to set the behavior of
search and add Dialog boxes before a page are
displayed, overriding the default behavior.

 There are two dialog behavior Settings:

o skip if possible (0) and


o Force display (1).

SetSearchDefault ([record  Use the SetSearchDefault function to set system


name.]fieldname) defaults (default values set in record field
definitions) for the
 Specified field on search dialog boxes. It does not
cause the FieldDefault event to fire.
 Note. This function remains for backward
compatibility only. Use the SearchDefault field
property instead.

 SetSearchDefault is effective only when used in


SearchInit PeopleCode programs.

 This example, from SearchInit PeopleCode turns on


edits and defaults for the SETID field in the search
 dialog box:

 SetSearchEdit(SETID);
 SetSearchDefault(SETID);

 If search default processing is cleared for a record


ClearSearchDefault ([record field, the default value specified in the record field
name.]fieldname)  Properties for that field will not be assigned when
the field appears in a search dialog box.

 This function is Effective only when used in


SearchInit PeopleCode.

ClearSearchEdit ([record
 Use the ClearSearchEdit function to reverse the
name.]fieldname)
effects of a previous call to the SetSearchEdit
function. If
 ClearSearchEdit is called for a specific field, the
edits specified in the record field properties will not
be
 Applied to the field when it occurs in a search
dialog.

Search Save
 This event is triggered after user clicks ok in search Dialog Box.

 Provides a way to edit the information entered in the search record dialog Box.

 Error statement in search save people code display the error message to the
user and prevent the search process from continuing.
RowSelect
 Component Processor reads data into Component Buffer based on search key
entered in the search Page.

 Rows can be prevented form loading into Component Buffer using people Code
Functions DiscardRows() and StopFetching.

 It is not recommended to discard row after it has been brought to Component Buffer
which is not an efficient approach.

 Error stops fetching the data

 Warning discards the row from the component buffer

Function used in this Event Description

 Use the DiscardRow function to prevent a row from


DiscardRow()
being added to a page scroll during Row Select
processing.

 This function is valid only in RowSelect


PeopleCode. When DiscardRow is called during
RowSelect

 Processing, the current row is skipped (not added to


the scroll).

 Processing then continues on the next row,


unless the StopFetching function has also been
called, in which case no more rows are added to the
page

 The StopFetching function is called during Row


select processing, during which rows of data that
StopFetching()
have been selected down from the database can be
filtered as they are added to the component.

 This function is valid only in RowSelect


PeopleCode. If StopFetching is called without
DiscardRow, it adds the current row to the
component, and then stops adding any more rows.
 If StopFetching is called with DiscardRow, the
system skips the
 Current row and stops adding rows to the
component.

PreBuild
 Pre Build Event fire once before the rest of the component Build Events
 It is used to Hide/Unhide pages ,initialize component or global Scope variable
 Warning /Error cancels the component

Field Default
 Sets default vale for the fields without any value
 Warning /Error cancels the component

Field Formula
 This event is always executed for all user action except save action
 Due to this it carries a significant performance overhead
 Recommended not to write people Code in this event to improve performance,
It is used to store the Library functions in Func Lib Records

Row Init
 Initialize the fields in the row, It occurs only one time for a row.
 This event is triggered when new row is added through row Insert.
 Warning /Error cancels the component

Post Build
 This event is used to calculate & set display characteristics of an object
 Code in RowInit is used to be placed in this event as it is executed only once.
 Warning /Error cancels the component
Page Activate
 This only event attached to a page , used to segregate application specific
logic from the page level.
 Used to control the appearance /initialize the objects in the page.
 This event is for only Standard pages & secondary pages not for sub pages
 Warning /Error cancels the component

Field Edit
 Event is triggered after system edits .It fires only on the specific field that has
changed
 Used to validate the content of the field
 Assignment statements should not be performed in field edits
 Field Edit People Code is placed on record field /Component Record field.
 Error causes effects as System Edits.

Field Change
 Event is triggered after field edit, Use to do processing based on the value
changed.
 Field Change People Code is placed on record field /Component Record
field.
 Error cancels the component
 RowInit ,Field Change are called complementary Events

RowInsert
 RowInsert is triggered when a new row is added to the scroll.
 Field Default and Row Init events are triggered after RowInsert
 To prevent users from adding new row ,in scroll properties select No Row
Insert Check Box

RowDelete
 RowDelete is triggered when a new row is deleted from the scroll.
 Field Default and Row Init events are triggered after RowDelete.
 To prevent users from adding new row, in scroll properties select No Row
Delete Check Box.

SaveEdit
 SaveEdit PeopleCode performs once the user tries to save the component. It is
use to validate the data before the data is committed into the database.
 It is used for only validation, assignment statement cannot be performed.
 Save Edit people code to all non deleted rows of data in the component Buffer.
 Validation done in save edit event is better than the validation done in the field
edit event.
 Error – prevents the component processor from saving the data

SavePreChange
 After SaveEdit is executed successfully, SavePreChange event is triggered.
 It provides one last chance to manipulate data before it is saving in the DB.
 Example:
New Employee ID generation.

WorkFlow
 All WorkFlow related functions are used in this event.
 Error – Cancels the Component.

SavePostChange
 Save Post Change People Code update data outside the component Buffer.
 Error – Cancels the Component, roll back all the updates made to the database
since last commit.
 On successful execution of the People Code in save post Change commit is
issued to the database.

You might also like