Thursday, March 6, 2014

PeopleCode events: SearchInit, SearchSave and RowSelect

Remember:
One thing you must know about peoplecode events is that component processor has some mean to check whether any peoplecode is written on an event or not and if there is no code written on an event, that event is not executed.

SearchInit:
Component processor determines search record, search keys, search mode and displays the search page accordingly in SearchInit event. That is why we can write the code for skipping the search pge on SearchInit event.
Following functions can be used in SearchInit: 
  1. SetSearchEdit
  2. ClearSearchEdit
  3. SetSearchDefault
  4. ClearSearchDefault
  5. SetSearchDialogBehavior

SearchSave:
SearchSave event happens when we click on search button of search page after entering the search values. We can write validations to check whether any search criteria is entered on the search page on SearchSave event. In SearchSave event itself search values appear listed in a grid on search page. If any error is issued on this event using peoplecode processing stops and no search result are listed on the page.

RowSelect:
After SearchSave event Rowselect event occures when we click on one of the result row listed on search page, But when in SearchSave if there is only one row returned then that row is automatically selected for RowSelect processing. In RowSelect processing we can check the values of row being selected and can discard that row using DiscardRow() or can stop fetching using StopFetching() function.

One must remember following things about that DiscardRow() and StopFetching(): 
  1. DiscardRow() stops current row from being added to page scroll and StopFetching() stops the fetching data to page.
  2. DiscardRow() acts as a warning and StopFetching() acts as an error in RowSelect event not by giving some prompt but by its functionality.

No comments:

Post a Comment