Apex Reference Guide
Summer '26 (API version 67.0)
Spring '26 (API version 66.0)
Winter '26 (API version 65.0)
Summer '25 (API version 64.0)
Spring '25 (API version 63.0)
Winter '25 (API version 62.0)
Summer '24 (API version 61.0)
Spring '24 (API version 60.0)
Winter '24 (API version 59.0)
Summer '23 (API version 58.0)
Spring '23 (API version 57.0)
Winter '23 (API version 56.0)
Summer '22 (API version 55.0)
Spring '22 (API version 54.0)
Winter '22 (API version 53.0)
Summer '21 (API version 52.0)
Release Notes
CommerceOrders Namespace
ComplianceMgmt Namespace
Context Namespace
DataRetrieval Namespace
ExternalService Namespace
Flowtesting Namespace
IssueCreditMemo Namespace
ind_mfg_sample_mgmt_apex Namespace
IndustriesDigitalLending Namespace
InvoiceWriteOff Namespace
PlaceQuote Namespace
renew_assets_summary Namespace
RevSignaling Namespace
RevSalesTrxn Namespace
RulesAppln Namespace
runtime_industries_cpq Namespace
runtime_industries_insurance Namespace
Slack Namespace
Database Namespace
The Database namespace
provides classes used with DML operations.
The following are the classes in the Database namespace.
-
Batchable Interface
The class that implements this interface can be executed as a batch Apex job. -
BatchableContext Interface
Represents the parameter type of a batch job method and contains the batch job ID. This interface is implemented internally by Apex. -
Cursor Class
Contains methods to fetch records and to get the number of cursor rows returned from a SOQL query. -
CursorFetchResult Class
This class encapsulates the result of a PaginationCursor.fetchPage() call. It contains methods that get the rows for the current page, the start index of the next page, and the number of deleted rows skipped during the fetch operation. It also contains a method that indicates whether the pagination cursor has fetched all available rows in the result set. -
DeletedRecord Class
Contains information about a deleted record. -
DeleteResult Class
Represents the result of a delete DML operation returned by the Database.delete method. -
DMLOptions Class
Enables you to set options related to DML operations. -
DmlOptions.AssignmentRuleHeader Class
Enables setting assignment rule options. -
DMLOptions.DuplicateRuleHeader Class
Determines options for using duplicate rules to detect duplicate records. Duplicate rules are part of the Duplicate Management feature. -
DmlOptions.EmailHeader Class
Enables setting email options. -
DuplicateError Class
Contains information about an error that occurred when an attempt was made to save a duplicate record. Use if your organization has set up duplicate rules, which are part of the Duplicate Management feature. -
EmptyRecycleBinResult Class
The result of the emptyRecycleBin DML operation returned by the Database.emptyRecycleBin method. -
Error Class
Represents information about an error that occurred during a DML operation when using a Database method. -
GetDeletedResult Class
Contains the deleted records retrieved for a specific sObject type and time window. -
GetUpdatedResult Class
Contains the result for the Database.getUpdated method call. -
LeadConvert Class
Contains information used for lead conversion. -
LeadConvertResult Class
The result of a lead conversion. -
MergeResult Class
Contains the result of a merge Database method operation. -
PaginationCursor Class
This class represents a pagination cursor that can traverse a SOQL query result set. It contains methods that fetch rows by page. It also contains a method that returns the total number of rows in the result set. -
QueryLocator Class
Represents the record set returned by Database.getQueryLocator and used with Batch Apex. -
QueryLocatorIterator Class
Represents an iterator over a query locator record set. -
SaveResult Class
The result of an insert or update DML operation returned by a Database method. -
UndeleteResult Class
The result of an undelete DML operation returned by the Database.undelete method. -
UpsertResult Class
The result of an upsert DML operation returned by the Database.upsert method.