Using PeopleCode to Populate Key Fields in Search Dialog Boxes
In a PeopleSoft Pure Internet Architecture application, you typically want users to directly access their own data. To facilitate this, you may want to use SearchInit PeopleCode to populate standard key fields in search page fields and then make the fields unavailable for entry. You might assign the search key field a default value based on the user ID or alias the user entered when signing in.
You must also call the AllowEmplIdChg function, which enables users to change their own data. This function takes a single Boolean parameter in which you pass True to allow employees to change their own data.
Here is a simple example of such a SearchInit program, using %EmployeeId to identify the user:
EMPLID = %EmployeeId;Gray (EMPLID);AllowEmplIdChg(True);