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.
This Utility as 2 parts to it
- 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).
- 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.
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 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.
- Save the customization and Publish it.
Demo screen of how TreeView Control looks on CRM form
Hope you find this Utility helpful for your Users.