Tuesday, October 13, 2009

Creating Custom Search for Custom Component

To create a custom search for a customized component, the steps are:

1) Create a search view for the main component.

2) Create a search page and add a page for the new search component. The best way is to make a copy of an already existing search page of delivered component e.g. customer. The reason is, there are work records which are required on the search page.

3) Create the search component and add those pages.

4) Create your own application class in the RB_FILTER application package and your class should extend FilterForm. Some of the basic methods needed in the simplest form are linkTo and addNew in your class apart from the constructor.

5) The grid which will display the search results on the search page should have the following item:

a) A push button/hyperlink e.g. RECORD.FUNCLIB_BO_CDM FIELD.GSRCH_LINK_PB.

b) Peoplecode on the field change event of the field for the pushbutton/hyperlink, which should create a component level object of your class and call the linkTo method in which you will pass the current row.

c) On the search button of the search page (RB_FLT_FORM_WRK.PB_FILTER2) do the same as above.

6) For adding a new record, on the add page, write code for fieldchange event of the Add button (FUNCLIB_BO_CDM.GSRCH_ADD_PB). Call addNew method of the component level object of your class and pass the current row (which contains default values e.g. 'NEXT' for key fields).

7) To transfer from the main component to the search component seamlessly, create an entry in the Component Navigation component. Create a local object of RB_CDM:RB_CDM_UTILITIES:ConfiguredTransfer class in searchInit event of the search record of your main component using the transactionId of the row created in the Component Navigation. Call the doTransfer method of the object. The effect is: When the user clicks Return to Search on the main component, it will take him/her to the search component search page.

8) Create a row in the Configurable Search setup in Setup CRM-> Common Definitions.


P.S. The search record for the search component should be Installation record.



No comments: