You need to sign in to do that
Don't have an account?

dynamic soql in for loop
I can't do direct assignment in my query because it returns more than 1000 rows, but I can't figure out how to query in a for loop. Normally it would look something like this
for (List<Account> accts : [SELECT id, name FROM account WHERE name LIKE 'Acme']) { // Your code here update accts; }
That's static sql...how would I pass a string that's being built based on filters selected in a VF page? We have a products page and they can select multiple filters & values and then query products. I can't figure out how to pass the string of SOQL that I built to a for loop(like above). Help!!!
Did you try
for (List<Account> accts : Database.query(String query)) { // Your code here update accts; }
I think you are talking about a visualforce page. If so, use Listcontroller to display.
Anyone has alternate solutions, please suggest.
Thanks