The below script is for doing filtered lookups based on a picklist value - nice piece of script!
document.FilterLookup = function(source, target)
{
if (IsNull(source) || IsNull(target)) { return; }
var name = IsNull(source.DataValue) ? '' : source.SelectedText;
name=encodeURIComponent(name);
target.additionalparams = 'search=' + name;
}
document.FilterLookup(crmForm.all.yourpicklistfieldname, crmForm.all.yourlookupfieldname);
Paste the following into the OnChange event of the Picklist:
document.FilterLookup(crmForm.all.yourpicklistfieldname, crmForm.all.yourlookupfieldname);
{
if (IsNull(source) || IsNull(target)) { return; }
var name = IsNull(source.DataValue) ? '' : source.SelectedText;
name=encodeURIComponent(name);
target.additionalparams = 'search=' + name;
}
document.FilterLookup(crmForm.all.yourpicklistfieldname, crmForm.all.yourlookupfieldname);
Paste the following into the OnChange event of the Picklist:
document.FilterLookup(crmForm.all.yourpicklistfieldname, crmForm.all.yourlookupfieldname);
1 comments:
Greate post. You should add only one step more. We need to add filter field in our entity form to filter by picklist.
Post a Comment