Sunday, December 19, 2010

Auto-Displaying / Skipping Search page results

If you need to have the search results defaulted when search page is loaded, then SetSearchDialogBehaviour function is used.

This function is normally used in the context of skipping the search page if you provide all wildcard values.

If a complete value is provided for all search keys before calling the SetSearchDialog behaviour function, then the search page will be skipped and the users will be taken directly into the transaction page. But the actual idea behind the function is that it will auto-trigger the search functionality. So naturally when just a wild card value is given to the search fields and the function invoked, then all the search results will be displayed.

Example for auto-displaying: If EMPLID is the only search field, the following code can be written to popualte the search results automatically on loading the search page.

/*Code in SearchInit.*/

REC.EMPLID.value = '%';
SetSearchDialogBehaviour(0);

Example for Skipping / Bypass: If EMPLID is the only search field, the following code can be written to skipp the search page.

/*Code in SearchInit.*/
EMPLID = %EmployeeId;
SetSearchDialogBehavior(0);

Note: SetSearchDialogBehavior can only be used in SearchInit PeopleCode.

Parameters: 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.

0 comments:

Post a Comment