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
http://ronaldlemmen.blogspot.com/2006/12/filter-data-in-crm-lookup-field.html

Comments

Popular posts from this blog

Error message “User does not have send-as privilege.” when sending emails programmatically in CRM 2011