Argos
Phil's CRM Blog | Statera CRM Blog: Pre-Filter Lookup

Statera CRM Blog: Pre-Filter Lookup

by Phil Adams 17. March 2010 14:57

 

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

Tags:

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



About Phil

Phil has been working with CRM since the BETA of CRM v1.0 and has seen a lot of the problems arising from installation, maintenance and Development.

Phil specializes in the ISV area of CRM; Creating Add-Ons and Plugins for various clients.

Phil currently works as a Microsoft Dynamics CRM Consultant and Developer for Cambridge Online Systems Ltd In the UK.

Phil also has several Microsoft Certifications in .NET and CRM