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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

The query may contain too many parameters. Please reduce the number of parameters and try again??

(0) ShareShare
ReportReport
Posted on by
Hello Everyone,
 
I want to add XDS security and i have enable the security on multiple users but unfortunately on few users i am facing this (PIC 1) kind of error with specific warehouse.
I have use this code on form data source level for filter the data as per the condition with i have mentioned in (PIC 2).
 
NOTE:
When i delete the specific warehouse on the user list form then everything will work fine. 
 
 
 
Pic 1:
 
 
 
 
Pic 2:
 
I have the same question (0)
  • Martin Dráb Profile Picture
    238,745 Most Valuable Professional on at
    Even if your code worked, using it would be a bad idea, because it's very inefficient.
     
    You load all fields of all transfer orders (for the given warehouse) and then filter transfer orders again by RecIds of those you found. Not only you don't need to fetch all other fields, but you also don't need the extra query at all. You can filter the query data source by InventLocationId directly. Just note that you'll need to use an expression there; just setting range values of InventLocationIdForm and InventLocationIdTo wouldn't result in the right query.
     
    By the way, I moved your thread from Dynamics 365 General forum, because it's clearly about F&O and not Dynamics 365 in general (which covers also products like Business Central or Sales).
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    Agreeing with Martin, here 2 whiles are not necessary. You can do a join so that a single while is enough like below.
    container c;
    
    while select <requiredFields> from wareHouseUserSetup
    where wareHouseUserSetup.userId = curUserid()
    join RecId from inventTransferTableLocal
    where <give relation>
    {
        c+= queryValue(inventTransferTableLocal.RecId);
    }
    
    //Add line 24 of your code and in the value put,con2str(c)
    So just give a relation as said in above code so that you will get a single while and select only fields you require. Then make all the recids available to a container and from that container, the range can be added. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 408

#3
Adis Profile Picture

Adis 267 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans