Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Issue with addCustomView on Multi-Select Lookup

Posted on by

Does anyone know, how addCustomView will work perfectly when it is applied on a multi-select lookup, It adds that view to the list but doesn't set to default or does't populate the filtered records even if i pass true in last parameter of addCustomview function.

it works fine for single entity lookups, but not for multi-select.

Xrm.Page.getControl("record2id").addCustomView(viewId, entitityName, viewDisplayName, fetchXml, layoutXml, true) is working fine for single entity selection lookup but not for multiple entity selection lookup.

any idea how that can be fixed?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Issue with addCustomView on Multi-Select Lookup

    Hi,

    I tried to implement this on Email TO field using below code:

    function preFilterLookup() {
        debugger;
        Xrm.Page.getControl("to").addPreSearch(function () {
            addLookupFilter();
    
        });
    }
    function addLookupFilter() {
    
        var fetchXml = '<filter type="and"><condition attribute="emailaddress1" value="%b%" operator="like"/></filter>';
        Xrm.Page.getControl("to").addCustomFilter(fetchXml);
    	
    }
    

    it Filters like this:
    47041.Capture.PNG

    The main issue with Multi entity lookup is to set filter as there are few common fields which are present in all entities. You can check for each lookup type and set a different condition for each lookup type.

  • RE: Issue with addCustomView on Multi-Select Lookup

    Dear friend- this doesn't work on lookup where it has many entities to choose on Lookup View window.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Issue with addCustomView on Multi-Select Lookup

    Refer this:

    andreaswijayablog.blogspot.sg/.../crm-2011-custom-filtered-lookup.html

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

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