Home

Oct 12, 2010

Modify the default entity type for lookup

 

In CRM, we use lookup field which has more than one entity to display. For e.g.Customer Lookup which is being displayed on contact record which displays Account as well as Contact record. You just need to select which type of entity records you want to see by selecting entity dropdown list of lookup. This dropdown list is defaulted to “Account”. If you want to change it to contact so that user can see all the contact when they open customer lookup instead of account.

You need to put below code on form load of entity:

if (crmForm.all.customerid != null )
{
    crmForm.all.customerid.setAttribute(”defaulttype”, “2″);
}

If you want to display one account or contact in customer lookup you can use below code in formload event of an entity:

//to display only accounts

if (crmForm.all.customerid != null )
{
    crmForm.all.customerid.setAttribute(”lookuptypes”, “1″);
}

//to display only contacts

if (crmForm.all.customerid != null )
{
    crmForm.all.customerid.setAttribute(”lookuptypes”, “2″);
}

Regards,

Amol

No comments: