SetSearchDialogBehavior function

Syntax

SetSearchDialogBehavior(force_or_skip)

Description

Use the SetSearchDialogBehavior function in SearchInit PeopleCode to set the behavior of search and add dialog boxes before a page is displayed, overriding the default behavior. There are two dialog behavior settings: skip if possible (0) and force display (1).

Skip if possible means that the dialog box is skipped if all of the following are true:

  • All required keys have been provided (either by system defaults or by PeopleCode).

  • If this an Add dialog box, then no duplicate key error results from the provided keys; if this error occurs, the processing resets to the default behavior.

  • If this is a Search dialog box, then at least one row is returned based on the provided keys.

Force display means that the dialog box displays even if all required keys have been provided.

The default behavior of the search and add dialog boxes is force display.

Note:

SetSearchDialogBehavior can only be used in SearchInit PeopleCode.

Note:

In the fluid implementation of configurable search, the SetSearchDialogBehavior function cannot be used to bypass or skip the search page.

Parameters

Parameter Description

force_or_skip

A Number equal to one of the following values:

  • 0: sets the dialog behavior to skip if possible.

  • 1: sets the dialog behavior to force display.

Returns

None.

Example

The following function call, which must occur in SearchInit PeopleCode, sets the dialog behavior to skip if possible.

SetSearchDialogBehavior(0);

Special Usage in Fluid Components

In a fluid component, if you set the search page type to None, you are bypassing the fluid search pages. You must use SearchInit PeopleCode or specify a search record that does not have a search key defined.

To avoid a known issue in PeopleTools 8.57 or earlier releases, if you create a SearchInit program, you must set all high-level keys and you must prevent the display of a non-functional search page using the SetSearchDialogBehavior function. For example:

#If #ToolsRel <= "8.57" #Then
   PSUSRSELF_SRCH.OPRID = %UserId;
   SetSearchDialogBehavior(0);
#Else
   PSUSRSELF_SRCH.OPRID = %UserId;
#End-If