I have an SOQL with LIMIT statement. The field list contains 164 fields of different types. Some of them are lookups, others are LongText, Text, Number.
The SOQL looks like this:
SELECT <fields> FROM <object__c> WHERE Field1__c = :value ORDER BY Lookup__r.Field2__c, Id LIMIT 200 OFFSET 0
When it runs in VF or Aura contexts, the number of rows returned is 62, although there are deffinetely more rows to return.
When I run this in a SOAP-call context or as anonymous apex, it returns all 200 rows I expect.
It also returns the complete result set of 200 rows when I replace the large field list with a list of 1-2 fields.
It also works correctly without OFFSET statement.
Is there an explanation of that behavior? And a way to workaround this..