Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Limitation of FetchXML regarding 'in' operator

Posted on by Microsoft Employee

Hi,

you can use custom filter for lookups in JavaScript, thus you can limit the data sets selectable in the lookup. E.g.:

Xrm.Page.getControl("new_userlookup").addCustomFilter(filter);

where the variable "filter" is a FetchXML like this:

<filter type='and'><condition attribute='domainname' operator='in'>
<value>mydomain\user1</value>
<value>mydomain\user2</value>
<value>mydomain\user3</value>
...
</condition></filter>

As you can see the filter consists of several specific data sets.

I Wonder if there's a limitation when using this kind of query - is it possible to specify unlimited data sets inside the FetchXML or this there any kind of limitation (e.g. only 50 data sets allowed etc.)? This is a general question, the code above is only a sample.

With best regards,

Michael

*This post is locked for comments

  • Verified answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: Limitation of FetchXML regarding 'in' operator

    The "In" filter should translate directly to SQL's "In" statement, and according to this reference, there is only the limitation of the query's total size:  

    stackoverflow.com/.../mysql-in-condition-limit

    The "condition" limitation, as identified in the materials Vijay presented, would apply if you were simulating "In" with a bunch of "Or" grouped conditions--which is terrible form--and I suspect you knew that when asking about "In".

    I've used "In" successfully up to 8000+ references; and haven't found a limit yet.  Again, according to the SQL documentation, the limit will likely be with the total size of the query message, rather than the number entries in the "In" set.

    For testing of FetchXML, you can test here online http://msxrmtools.com

    mark my suggestion as verified if 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

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