web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
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.

I have the same question (0)
  • Martin Dráb Profile Picture
    240,020 Most Valuable Professional on at

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

  • Suggested answer
    Vigsan_MS Profile Picture
    Microsoft Employee on at

    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

  • Soluzione IT Profile Picture
    80 on at

    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 92 Super User 2026 Season 1

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 71 Super User 2026 Season 1

#3
Sagar Suman Profile Picture

Sagar Suman 56 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans