Header Ads

  • Recent Posts

    SearchClear

    Within a PeopleSoft menu across components using same fields for search keys(irrespective of different Search Records) in the search page, the identical search key values from one component gets displayed in another component's search page. Also when "Return to Search" is clicked within a component, the search record values get populated again in the search page.

    This delivered PeopleSoft behaviour is not always desired. The best way to clear these values is by making use of the delivered PeopleSoft method - SearchClear. It is better to avoid defaulting these field values to blank in either SearchInit or FieldDefault events and instead make use of the SearchClear method.

    SearchClear() method is a method of both the record and field classes. This method works only on the search keys of a record used as a search record for that component.

    If the SearchClear() method is used on a field class which is a Search Key, then the particular search key field value is cleared and the search page will not copy this field back again.

    If the SearchClear() method is used on a record class which is a Search record for that component, then the values of all the search keys of that search record are cleared.


    Code Examples:
    a) SearchClear() method in a Field Class:
    Local Field &FIELD;
    &FIELD = GetField(Recordname.Field);
    &FIELD.SearchClear();
    b) SearchClear() method in a Record Class:
    Local Record &REC;
    &REC = GetRecord();
    &REC.SearchClear();

    Considerations in using SearchClear() and SetDefault method(excerpted from PeopleBook):
    • The SetDefault method causes a field to be set to its default value (if there is one) immediately after SearchInit PeopleCode finishes.
    • SetDefault overrides SearchClear.
    • If you call SearchClear for a record, then use SetDefault for a field, the field is set to its default value and the search key values for the rest of the record are cleared.

    No comments

    Please refrain for marketing messages and unnecessary back links.

    Post Top Ad

    Post Bottom Ad