This CRM 2011 WebResource Utility will enable Users to use TreeView control to select Lookup data where Lookup is having Self Joined.

For example, account entity is having Parent Account entity or System User is having Manager, which allows to have hierarchical data. Such hierarchical data is shown in TreeView format.

TreeView control is embedded into CRM main form which facilitates Users to quickly browse through TreeView and make appropriate selection.

Demo Video

This Utility as 2 parts to it

  1. A Silverlight WebResource form which will enable System Customizer to create one time Data (XML) WebResource for each entity where there is Parent-Child relationship (self join).
  2. A TreeView WebResource web control which need to be embed into CRM form with the help of JavaScript functions.
  • Creating Data (XML) WebResource for Lookup entity
    • When Managed solution is installed on CRM, it will show navigation link “TreeView for Lookup” under Settings –> Customization
    • Clicking on “TreeView for Lookup” will open a Silverlight Form.
    • Instructions are given in Silverlight form as how to use the form.
    • Note the WebResource name that you have just created on updated.

image

 

image

Note: Maximum records return my Fetch Query is 5000, so if you have more than 5000 records XML will contain only 5000 records.

  • Adding TreeView control to Form
    • Open a form customization to which TreeView control needs to be added.
    • Add HTML WebResource “treeview_/HTML/TreeView.htm” to form. Give appropriate name to WebResource.
    • On Form properties add JavaScript Library “treeview_/Script/TreeView.js

image

  •  
    • On Form Load event add function function LoadCodeTree(webResourceId, lookupAttributeId, lookupEntityName, xmlWebResourceName)
      • webResourceId = Name of HTML WebResource which added to CRM from
      • lookupAttributeId = Id for Lookup attribute on form for which TreeView control needs to be shown
      • lookupEntityName = Name of Lookup attribute Entity, this should be logical name and not Display Name
      • xmlWebResourceName = Name of Data (XML) WebResource which is created earlier using Silverlight form.

image

  •  
    • Save the customization and Publish it.

Demo screen of how TreeView Control looks on CRM form

image

 

Hope you find this Utility helpful for your Users.

Last edited Nov 25, 2011 at 10:26 AM by makarand_keer, version 6