Skip to Content
Author's profile photo Former Member

CRM 7.0 How to –5E Search View and Search Result

So far I have covered how to create a customer component, create views, navigate to and fro from one view to another, how to bind the context nodes etc.

 

In this blog I will talk about how to create a search view and search result.

 

This blog will touch all the topics covered so far starting from the component creation.

   

Step1: In tr. BSP_WD_CMPWB create a new component and assign the model “ALL” as shown below.

 

image

 

 

Step2: This step is more for your concept. Look for the BOL model Browser –> The Query result Object is BTQR1Order the root object is BTOrder and the relation is via BTADVS1Ord.

 

image

 

Step3: Create a custom controller, Add the BOL entity BTQR1Order which is the query result and then complete the wizard.

image

image

image

Step4: Now create a context node BTOrder

image

image

image

 

Here you know the reason why I have used Higher-LvlContextNode = BTQR1ORDER and BOL Relation = BTADVS1Ord. If not then check the step 2 again. After completing the wizard you should see the Newly added context node in the tree as shown below.

 

image

 

Step5:  Create a view for search purpose

 

image

image

image

 

Skip the attribute section. Create Links to custom controller:

  1. Pick the result context node from the dropdown created above
  2. Select the UI component in which you are working(ZVKS)
  3. Select the Custom Controller QueryCuCo by suing F4
  4. Select the context node for result created above

 

image

 

Select view type empty and complete the wizard

 

image

 

One thing you must have noticed that the wizard has generated the binding code for you.

 

image

 

Step6:  Now create a view for search result

 

image

 

Add 2 Model Nodes as shown below

 

image

 

Skip the attribute section. Create Links to custom controller

 

image

 

Choose view type = table view and complete the wizard

 

image

 

 

Step7:  Create a ViewSet

 

image

 

Give some name e.g. SearchVS , Enter 2 for lines and 1 for column

 

image

 

Define View are one for search view and one for search result view and complete the wizard.

 

image

 

Step8: Put the views and viewset together and make it available at runtime

 

  1. Go to runtime repository in edit mode
  2. Set the window as default.

image

 

Enable the display of the ViewSet at runtime by right clicking on the view MainWindow and additing the ViewSet.

 

image

 

Assign the views to the view set and save your changes

 

image

 

Step9: Now in order to get some basic F4 helps without additional coding efforts change the inheritance of search view as shown below

 

image

 

image

 

Change the highlighted class with class CL_BSP_WD_ADVSEARCH_CONTROLLER as shown below

 

image

 

 

image

 

Now change the inheritance of the class of search context node with class CL_CRM_UIU_BT_ADVS_CN

 

image

 

image

 

image

 

Step10: Replace the htm coding of the search view by following coding

 

image

 

Now you can do configuration of the search view. Start the transaction BSP_WD_CMPWB again and the configuration tab should appear for the view

 

image

 

Adjust the search result view

 

image

 

Now you can do configuration of the search result view

 

image

 

Adjust the viewset

 

image

 

The reason why I used ‘Query’ and ‘Result’ in the above code is the view area defined in the view set

 

image

 

Now create an event on the search page to react on the search button

 

image

 

image

 

Implement the hyperlink for the attribute OBJECT_ID

 

image

 

image

 

You can test your application now

 

image

 

This is what we have achieved so far

 

image

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Hi Vikash,

      Thank you very much for this.
      I am facing a small issue, once the code for search.htm is done and got into the component again.
      Not able to view the configuration.

      Can you pls help?

      Author's profile photo Former Member
      Former Member
      Hi Vikash ,

      Thanks very much for this.
      I have the same issue with the Lakshmi Menon,
      once the code for search.htm is done and got into the component and found the 'Selected Search Criteria' is empty.

      Can you pls help?

      Author's profile photo Former Member
      Former Member
      Hi Vikash

      Many thanks for sharing. Your blog series is a must for the CRM technical beginner!

      I have a question for step 2.

      I see only "Attribute Structure", but not the "Relations", is that because of CRM version or is it something missing?

      Very much appreciate your feedback...
      thank you

      Author's profile photo Former Member
      Former Member
      Thanks a lot for the demo. That helped a lot in understanding concepts.

      I had one more reqirement...how can we integrate this component into the web ui as a search link in a work center.