I am trying to implement a dynamic SOQL like this:
List<Contact> conList = Database.query(query);
System.debug('ConList size: ' +conList.size());
if(!conList.isEmpty()){
//Some code
}
I have received this error on my VF page as I am using <apex:repeat> over the list of Contact records:
Collection size 1,500 exceeds maximum size of 1,000.
So I have updated my List collection to a Map like this:
Map<Id, Contact> conMap = new Map<Id, Contact>((List<Contact>)Database.query(query));
I am still getting the same error. Is there a way I can use a Map for this issue?
References
- Solution from this thread
- Another SFSE thread that proves Map can be exempted from this limitation. And I am still find this issue even after using Map.
Database.query(query)such that I won't get this error? – Austin Evans Nov 08 '19 at 15:40