We have a scenario where in we need to dynamically set a custom filter of contact to customer lookup but the problem is that it displays account view only. When we add a new custom filter to remove account view it displays custom contact which is correct, but contact custom view does not comes when we click on look for more records. Is there a way on how to remove the previously added custom filter on a customer lookup so that account view does not appear and contact custom view appears?
To remove account view we have used following code:
var account_filter = "<filter type='and'>" +
"<condition attribute='accountid' operator='null' />" +
"</filter>";
Xrm.Page.getControl("customerid").addCustomFilter(account_filter, "account");
Thanks in advance.
*This post is locked for comments
Hello ,
Seems the function is not triggering second time , where do you register this function?
Try to register the function onchange of the field for which field change you want to filter the lookup.
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156