← back to the release
new featureApex

Process Data 360 Data Model Objects with Apex Cursors (Beta)

Apex cursors now work with Data 360 data model objects (DMOs): create one with Database.getCursor() against a DMO SOQL query, page through results with Cursor.fetch(position, size), and get the total with Cursor.getNumRecords(). Cursors expire 24 hours after creation and throw System.InvalidQueryLocatorException if they expire mid-run; SOQL against DMOs consumes Data Services credits, and Data 360 cursor rows, cursor instances, and Flex Credit limits are exposed on the Limits class. Available in API version 68.0 and later.

identifiers
Database.getCursorCursor.fetchCursor.getNumRecordsSystem.InvalidQueryLocatorExceptionDatabase.CursorDMO
api versions
68.0
flags
off by defaultno action requiredmin api 68
how
Call Database.getCursor() with a DMO SOQL query and fetch records in chunks, typically from a Queueable that re-enqueues itself.
who
when
Beta.
where
Enterprise, Performance, Unlimited, and Developer editions; API 68.0+.
read it on salesforce.com