Building QueryMore Functionality in Apex: a SOQL OFFSET

PHOTO EMBED

Thu Jul 01 2021 12:39:52 GMT+0000 (UTC)

Saved by @redflashcode

SELECT Name, NumberOfEmployees
FROM Account
WHERE 
    Name > :sortByFieldValueFromLastRow || 
    (Name = :sortByFieldValueFromLastRow AND Id > :idFromLastRow)
ORDER BY Name, Id
LIMIT 500
content_copyCOPY

https://sfdc.danielzeidler.com/2019/08/18/building-querymore-functionality-in-apex-a-soql-offset-alternative/