SearchInit Event

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 enables you to control processing before a user enters values for search keys in the dialog box. In some cases, you may want to set the value of the search dialog fields programmatically. For example, the following program in SearchInit PeopleCode on the component search key record field EMPLID sets the search key page field to the user’s employee ID, makes the page field unavailable for entry, and enables the user to modify the user’s own data in the component:

EMPLID = %EmployeeId;
Gray (EMPLID);
AllowEmplIdChg(True);

You can activate system defaults and system edits in the search page by calling SetSeachDefault and SetSearchEdit in SearchInit PeopleCode. You can also control the behavior of the search page, either forcing it to appear even if all the required keys have been provided, or by skipping it if possible, with the SetSeachDialogBehavior function. You can also force search processing to always occur by selecting the Force Search Processing check box in the component properties in PeopleSoft Application Designer.

Note:

This event, and all its associated PeopleCode, does not initiate if run from a component interface.

SearchInit PeopleCode can be associated with record fields on search records and prompt table records and on component search records and component prompt table records.

SearchInit with Prompt Dialogs

Beginning with PeopleTools 8.50, you can put PeopleCode on the SearchInit and SearchSave events on the search keys of prompt table records. SearchInit and SearchSave events will only execute if the Allow Search Events for Prompt Dialogs check box was selected for the search key’s record field properties in Application Designer. By default Allow Search Events for Prompt Dialogs is off.

Note:

Search processing with prompt dialogs can affect performance. Oracle recommends that you limit the use of PeopleCode with prompt dialogs.

SearchInit PeopleCode Function Restrictions

You cannot use the following functions in SearchInit PeopleCode:

  • DoModal, DoModalComponent, DoModalX, and DoModalXComponent

  • Transfer, TransferExact, TransferNode, TransferPage, and TransferPortal