When we put Lookup control on CRM 2011 form, by default it shows only one attribute (mostly name attribute) of the Lookup entity. If User wanted to see more detail information about Lookup record, they can click it and open Lookup details form. Although this serves the purpose, it’s still an extra click that user have to make to see the details of Lookup field.
It would have been good if User don’t have to click and can see Lookup entity fields data in Child form itself. CRM does provide Entity Mapping which allows to Pre-populate mapping attributes at the time of creation of Child record, however it has its own limitations. To overcome some of the limitations of Entity Mapping I have created a Web Resource Utility which can be found at CRM 2011 Attribute Mapping
I also developed more light weight Web Resource Utility which does not required any Entity Mapping and still give Lookup Entity field data on CRM 2011 main form.
Following screen shot demonstrates the utility
Demo Screen:1
Each Lookup field can have their corresponding Web Resource on form. With the help of my JavaScript library CRM Customizer can decide attributes of the Lookup entity to be shown on form in tabular format.
Web Resource can be placed anywhere on the form.
Demo Screen: 2
If Lookup attribute is empty, Utility will still show the Empty Web Resource.
Demo Screen: 3
Utility does cover error situations. In case CRM customizer have incorrectly set parameters in JavaScript Library or if columns got deleted from Lookup attribute after it is configured in child form JavaScript library, utility does show appropriate message to take corrective action.
Instructions
Managed Solution contains following components
1. lookupr/Scripts/jquery_1.6.4.min.js
2. lookupr/Scripts/SDK.RetrieveData.js
3. lookupr/Scripts/LookupPreviewScript.js
4. lookupr/Lookup_Preview.htm
Steps
1. Open the form on which you wanted to put Lookup Preview.
2. Add a Web Resource to form
3. Save the Customization.
4. In form Properties, select JavaScript web resources as shown below
5. Event Handler
On Form OnLoad even select library as lookupr/Scripts/LookupPreviewScript.js and function as LoadLookPreviewDelayed
Function LoadLookPreviewDelayed takes following arguments
1.Web Resource Name : This is Name of Lookup_Preview.htm that was give in earlier step
2. Lookup Attribute Id: AttributeID of Lookup Attribute for which Lookup Preview is required.
3. Attribute Set: This is pipe (|) separated list of Label and attribute name from Lookup entity which needs
to be shown in Lookup Preview. Label and Attribute Name must be separated by#
Example for Attribute Set is 'Job Title#jobtitle|EmailId#emailaddress1|Telephone#telephone1|Language#new_preferredlanguage|DoNotEmail#donotemail'