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
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156