function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ChristianralphChristianralph 

Testing SOQL Limits

When constructing a dynamic SOQL query, the Limit does not seem to work in test code, but it does work in production code.

 

Please see question posted on StackOverflow

http://stackoverflow.com/questions/3998037/soql-limit-clause-not-working-in-dynamic-query-using-like

ChristianralphChristianralph

Note: I have renamed the link. Please read here;

http://stackoverflow.com/questions/3998037/limit-not-working-when-testing-dynamic-soql

 

thanks

 

Christian

Imran MohammedImran Mohammed

I tested dynamic SOQL in the test method with a limit clause and it worked fine without any issues.

I suggest you to put some system.debug prior to assertion to check the size of the accounts list returned.

Hope this way you will come to know whats happening.

ChristianralphChristianralph

Thanks for the reply..

 

yes I tried this and the size() of the results set is 6000+ records.