Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Suggested answer

Custom XML Filter for lookupfield

(0) ShareShare
ReportReport
Posted on by 225

I have managed to build a Custom-lookup-field with Mutliselection with the help of the  Xrm.Utility.lookupObjects(lookupOptions)-function. Everythings work fine.

But I have to filter the views. I know, that I can add custom filters to my lookupOptions. But I have no idea how to create such a filter in XML.

Do anybody know a link where I can find informations about that? 

The Filter should work like this:

The Lookupfield is on a case-form. With this lookup you can choose the product (customentity) which belongs to the case. But in this field you should only see the products of the customer. The products are linked to the customer.

  • Soluzione IT Profile Picture
    Soluzione IT 80 on at
    RE: Custom XML Filter for lookupfield

    Hi Ar0x,

    Below is the sample code of how you can create the custom view filter via XML.

    					//Random view guid
                        var viewId = "026e2e12-4512-4fc9-aee8-e938afe748d6";					
    					//Entity logical name for which you have to create custom view
                        var entity = "jasanz_technicalresource";
    					//View display name
                        var ViewDisplayName = "Filtered Technical Resources";
    					//Fetch xml you want to create
                        var fetchXML = ""
                              ""
                              ""
                              ""
                              ""
                              ""
                              ""
                              ""
                              ""
                              ""
                              ""
                              ""
                              condition
                              ""
                              ""
                              ""
                              ""
                              "";
    					//Layout column of the view
                        var layout = ""  
                            ""  
                            ""  
                            ""  
                            "";
                        //Filter view
                        formContext.getControl("jasanz_technicalresourceid").addCustomView(viewId, entity, ViewDisplayName, fetchXML, layout, true);

    Best Regards,

    Kirti Singh | Soluzione IT Services

    Please mark as verified if the answer is helpful.

  • Suggested answer
    Vigsan_MS Profile Picture
    Vigsan_MS on at
    RE: Custom XML Filter for lookupfield

    Hi Ar0x,

    This has been posted in Dynamics 365 Supply chain management forum. But the query is related to Dynamics 365 customer engagement customization.

    Please refer to the below URL on creating xml filter for look up field.

    www.inogic.com/.../

    If you still have queries kindly post in the appropriate forum.

    Regards,

    Vignesh

  • Martin Dráb Profile Picture
    Martin Dráb 230,445 Most Valuable Professional on at
    RE: Custom XML Filter for lookupfield

    XRM? Are you sure you're in the right forum?

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans