Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Apply Filter Customer Lookup Field in Case Form

Posted on by 1,730

Hi Experts,

I have a lookup Field contain both account and Contact Records just like Customer Field in Case Form. I want to Show Records of only account with RelationShip type is Customer . Then What we prefer to filter that lookup field like using addCustomFilter but How we create that filter condition in that.

Thanks in advance.

Ajyendra

*This post is locked for comments

  • Suggested answer
    ajyendra Profile Picture
    ajyendra 1,730 on at
    RE: Apply Filter Customer Lookup Field in Case Form

    Hi Pawar Pravin ,

    Thanks for the reply.

    But I figure out the solution by myself

    var contactFilter = "<filter type='and'><condition attribute='contactid' operator='null' /></filter>";
    var accountFilter = "<filter type='and'><condition attribute='customertypecode' operator='eq' value='3' /></filter>";
    
    Xrm.Page.getControl("customerlookupfield").addCustomFilter(contactFilter, "contact");
    Xrm.Page.getControl("customerlookupfield").addCustomFilter(accountFilter, "account");

    ]

    Thanks

    Ajyendra

    If this answer is helpful. Please Mark as Verified.

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Apply Filter Customer Lookup Field in Case Form

    Have you checked JS mentioned in below url ?

    www.powerobjects.com/.../

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,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans