2

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.

  • This technique is called list of lists. Check the answer of @krishsfdc – Sergej Utko Jun 9 '16 at 13:54
4

You can do so by this steps:

  1. Get the count of external object.
  2. Divide this by 2000, use this value in the for loop condition.
  3. In the loop query the object and add the records to a list.
  4. for every iteration add the records to the list.
  5. 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 – saru Jun 20 '16 at 10:19
0

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.

  • is it for external lightning connect objects? – Pranay Jaiswal Jun 10 '16 at 12:55
  • @susanoochidori For display yes – user24634 Jun 10 '16 at 13:00
  • Yes It is the limitation for external object. – saru Jun 13 '16 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.