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
Jayaramu T 9Jayaramu T 9 

I want to avoid "database.query(cvQuery)" this in for loop because it is getting toomany SOQL statements can any one please help me on this?

for(List<ContentVersion> cvObjList : database.query(cvQuery))
Sandeep YadavSandeep Yadav
Hi Jayaramu,
You can save the result of database.query(cvQuery) statement in a List of sObject Type and then u can iterate that list.
like this
List<ContentVersion> objList = database.query(cvQuey);
for(ContentVersion cv : objList){
   // your logic
Let me know if it is helpful for you or not.