Thursday, August 2, 2007

Custom Lookups in CRM 3.0

We need to create custom look ups in CRM 3.0 to make life easier for the people who enters the information.
imagine when you create a case first you have to select the company which the case reported and then select the contacts from that company who reported that case. it would be very easy for the data entry person when he/she selects the account only the contacts listed for that account wil be displayed. by default CRM doesn't support this. but you can use javascripts to do this.

You can use the following fecth statement for the onchange event of the account look up.

crmForm.all.new_reportedid.lookupbrowse = 1; // This turn on filter crmForm.all.new_reportedid.additionalparams = "fetchXml= "; crmForm.all.new_reportedid.additionalparams += "&selObjects=2&findValue=0";

crmForm.all.sa_customerid.DataValue[0].id = This should be the field name of the account id in your form.

selObjects=2 - referes to the object type code of the entity. Normally contact entity has the object type as 2.

crmForm.all.new_reportedid = This should be the field name of the contact look up.

selObjects variable specifies the object type code of the entity.

This is something that i had to do in one my projects using CRM 3.0. i was greately helped by the artical posted by Ronal Lemman. you can find his article at

No comments:

Post a Comment

Retrieving Calendar of a Bookable Resource in Dynamics

There are occasions where we need to retrieve working days and working times of a resource in Dynamics grammatically. This is quite possible...