Pre-Filter Lookup

Pre-Filter Lookup

 http://blog.expertsoftware.co.uk/post/2010/03/17/Statera-CRM-Blog-Pre-Filter-Lookup.aspx

I ran across some code today that will pre-filter a lookup field based on a selection in another lookup field.
Put this in the onChange of the first lookup:
document.filterLookup(crmForm.all.customerid, crmForm.all.contactid);
Put this in the onLoad of the form:
// Filtered lookup
document.filterLookup = function (source, target) {
if (IsNull(source) IsNull(target)) {
return;
}
var name = IsNull(source.DataValue) ? ” : source.DataValue[0].name;
target.additionalparams = ‘search=’ + name;
}
For a more in-depth method of achieving this, visit this blog: http://jianwang.blogspot.com/2008/05/mysterious-crm-lookup-ii.html

Statera CRM Blog: Pre-Filter Lookup

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: