Archive

Archive for the ‘Lookup’ Category

CRM 2011–TreeView Control

October 27, 2011 21 comments

MS Dynamics CRM allows us to have an entity with Self-Join that is we can establish Parent-Child relationship with itself. This relationship makes it easier to store hierarchical data in single CRM entity. This type of relationship can be used to store Taxonomy data. For Example Area-Region-Subsidiary-Country or Sales Territories.

I have developed a CRM 2011 WebResource which will render self-joined Entity data in Tree View structure and which can be used to assigned to Lookup attribute on CRM 2011 form.

This Utility has 3 parts

1. Mechanism to render data from Self-Joined entities and convert it to XML Web Resource form.

2. On CRM form bind XML Web Resource data to TreeView control

3. Wiring event to populate Lookup attribute on CRM form when User select one of the Tree View Node.

Demo Screen 1

This WebResource is easily portable on CRM Form and it needs just one JavaScript call to set Lookup Attribute for which data need to be rendered.

Let me know if anybody interested in having CRM Managed Solution for this WebResource and I will be glad to share it.

Any ideas to improve this TreeView control is welcomed.

[Updates: 11/03/2011]

Thanks all those who showed interest in TreeView utility. I am currently working on Packaging the Utility into CRM 2011 Managed Solution, once completed with Testing I will share the Managed Solution

 

[Updates: 11/07/2011]

Finally I could complete packaging Beta releases for two separate Projects !!!

These projects are now available in CodePlex. In case you come across any issues send me an email.

CRM 2011 TreeView for Lookup

CRM 2011 TreeView for Dependent Picklist

CRM 2011 Lookup Preview on CRM Form

October 10, 2011 3 comments

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

Demo_Screen_1_thumb3

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

Demo_Screen_2_thumb3

If Lookup attribute is empty, Utility will still show the Empty Web Resource.

Demo Screen: 3

Demo_Screen_3_thumb3

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

Instruction_1_thumb1

    1. Select Web Resource as lookupr/Lookup_Preview.htm
    2. Give Name and Label to Web Resource, note exact name of WebResource for later use.
    3. In “Formatting” tab select Number of rows, minimum 2 rows are required, but depending upon data length this number can be increased.
    4. Unselect “Display border”.

3. Save the Customization.

4. In form Properties, select JavaScript web resources as shown below

Instruction_2_thumb1

5. Event Handler

Instruction_3_thumb1

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’

Video Demo

 

 

Download CRM Managed Solution 
Follow

Get every new post delivered to your Inbox.