RSS

Tag Archives: setAttribute

CRM 2013 Manipulate Look up to show Multiple Entity Record

Introduction

Sometimes, we need to show multiple Entity record in the Look up of single Entity Look up in CRM 2013 like the Picture shown below. This Look up Dialog Box shows the record of two Entities, but the Look up is only of Contact

Two Entity Look Up

Solution

We can achieve this function by following code.

//Setting the lookup type
document.getElementById(LookUp_Logical_Name + "_i")
        .setAttribute("lookuptypes", 
                      "<EntityTypeCode of Entities to be shown in the look up>");

//Setting the lookup name Ex :- account:1:Account,contact:2:Contact
document.getElementById(LookUp_Logical_Name + "_i")
        .setAttribute("lookuptypenames", 
                      "[<Logical name>:<EntityTypeCode>:<Schema Name of Entity>]");

//Setting the lookup icon  Ex:-/_imgs/ico_16_1.gif:/_imgs/ico_16_2.gif
document.getElementById(LookUp_Logical_Name + "_i")
        .setAttribute("lookuptypeIcons", 
                      "/_imgs/ico_16_<EntityTypeCode>.gif");

// default type - Account entity To set the default entity
document.getElementById(LookUp_Logical_Name + "_i")
        .setAttribute("defaulttype", 
                     "<EntityTypeCode>");

By Sukant Shekhar
Senior Software Engineer @Team DynamicsCRM.
Mindfire Solutions

Advertisements
 

Tags: , , , , , , , , , , , , , , , , , , , ,

 
%d bloggers like this: