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.
Hi Partner,
Now the "addPreSearch" has been moved to formContext.getControl();
Please try "formContext.getControl(arg).addPreSearch(myFunction)".
Regards,
Leo
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156