Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Add Custom View in customer lookup and remove account view from lookup.

Posted on by Microsoft Employee

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

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Add Custom View in customer lookup and remove account view from lookup.

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans