Pre-Filter Lookup

Pre-Filter Lookup

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)) {
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:

Statera CRM Blog: Pre-Filter Lookup


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: