I am able to fetch for each soql only 2000 records(Due to Governer limitis) for external objects. but i want to fetch the remaining records and pass the remaining list also to vf page to display the records. Please let me know how to overcome this governor limit issue and display all the records in Vf page.
2 Answers
You can do so by this steps:
- Get the count of external object.
- Divide this by 2000, use this value in the for loop condition.
- In the loop query the object and add the records to a list.
- for every iteration add the records to the list.
- One more thing to take of is that, put the offset 2000 * n, where n = 1,2,3.. in the query so that the records will not be duplicate.
After this steps you will get all the records to display on the vf page.
Hope this helps you!!
-
Hello,Count() is not supporting for external objects.Any suggestion can helpful here– saruCommented Jun 20, 2016 at 10:19
If this is a Visualforce page you can use the readOnly attribute to allow the display of upto 1 million records like so:
<apex;page readOnly="true">
As the name suggests, you can only use this to view the records, not perform any action on them.
-
-
@susanoochidori For display yes– user24634Commented Jun 10, 2016 at 13:00
-
list of lists
. Check the answer of @krishsfdc