Reputation: 414
I am trying to filter the lookup based on some conditions and hence using addPreSearch. I am using the following code,
function filterLookup() {
debugger;
try {
var conditionalattribute= Xrm.Page.getAttribute("vrp_conditionalattribute").getValue();
if (conditionalattribute!= null && conditionalattribute!= undefined)
{
Xrm.Page.getAttribute("filteredattribute").addPreSearch(function () {
addLookupFiler();
});
}
}
catch (e) {
console.log(e.Message);
}
}
But I am getting below error on addPreSearch line
Please note that I am using CRM v8.2.
Upvotes: 0
Views: 1562
Reputation: 5531
you do not get presearch on attribute but rather it's control
formContext.getControl(arg).addPreSearch(myFunction)
Upvotes: 1