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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Limitation of FetchXML regarding 'in' operator

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Verified answer
    Rawish Kumar Profile Picture
    13,758 on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans