Apex Developer Guide
Newer Version Available
Apex Language Reference
DML statements are part of the Apex programming language. You can use them to insert, update, merge, delete, and restore data in Salesforce.
Apex classes and interfaces are grouped by the namespaces they’re contained in. For example, the Database class is in the System namespace. To find static methods of the Database system class, such as the insert method, nagivate to System Namespace | Database Class. The result classes associated with the Database methods, such as Database.SaveResult, are part of the Database namespace and are listed under Database Namespace.
SOAP API methods and objects are also available for Apex. See SOAP API and SOAP Headers for Apex.
-
Apex DML Operations
You can perform DML operations using the Apex DML statements or the methods of the Database class. For lead conversion, use the convertLead method of the Database class. There is no DML counterpart for it. -
ApexPages Namespace
The ApexPages namespace provides classes used in Visualforce controllers. -
AppLauncher Namespace
The AppLauncher namespace provides methods for managing the appearance of apps in the App Launcher, including their visibility and sort order. -
Approval Namespace
The Approval namespace provides classes and methods for approval processes. -
Auth Namespace
The Auth namespace provides an interface and classes for single sign-on into Salesforce and session security management. -
Cache Namespace
The Cache namespace contains methods for managing the platform cache. -
Canvas Namespace
The Canvas namespace provides an interface and classes for canvas apps in Salesforce. -
ChatterAnswers Namespace
The ChatterAnswers namespace provides an interface for creating Account records. -
ConnectApi Namespace
The ConnectApi namespace (also called Chatter in Apex) provides classes for accessing the same data available in Chatter REST API. Use Chatter in Apex to create custom Chatter experiences in Salesforce. -
Database Namespace
The Database namespace provides classes used with DML operations. -
Datacloud Namespace
The Datacloud namespace provides classes and methods for retrieving information about duplicate rules. Duplicate rules let you control whether and when users can save duplicate records within Salesforce. -
DataSource Namespace
The DataSource namespace provides the classes for the Apex Connector Framework. Use the Apex Connector Framework to develop a custom adapter for Salesforce Connect. Then connect your Salesforce organization to any data anywhere via the Salesforce Connect custom adapter. -
Dom Namespace
The Dom namespace provides classes and methods for parsing and creating XML content. -
EventBus Namespace
Contains a class used for platform event triggers. -
Flow Namespace
The Flow namespace provides a class for advanced Visualforce controller access to flows. -
KbManagement Namespace
The KbManagement namespace provides a class for managing knowledge articles. -
Messaging Namespace
The Messaging namespace provides classes and methods for Salesforce outbound and inbound email functionality. -
Metadata Namespace
The Metadata namespace provides classes and methods for working with custom metadata in Salesforce -
Process Namespace
The Process namespace provides an interface and classes for passing data between your organization and a flow. -
QuickAction Namespace
The QuickAction namespace provides classes and methods for quick actions. -
Reports Namespace
The Reports namespace provides classes for accessing the same data as is available in the Salesforce Reports and Dashboards REST API. -
Schema Namespace
The Schema namespace provides classes and methods for schema metadata information. -
Search Namespace
The Search namespace provides classes for getting search results and suggestion results. -
Sfc Namespace
The Sfc namespace contains classes used in Salesforce Files. -
Site Namespace
The Site namespace provides an interface for rewriting Sites URLs. -
Support Namespace
The Support namespace provides an interface used for Case Feed. -
System Namespace
The System namespace provides classes and methods for core Apex functionality. -
TerritoryMgmt Namespace
The TerritoryMgmt namespace provides an interface used for territory management. -
TxnSecurity Namespace
The TxnSecurity namespace provides an interface used for transaction security. -
UserProvisioning Namespace
The UserProvisioning namespace provides methods for monitoring outbound user provisioning requests. -
VisualEditor Namespace
The VisualEditor namespace provides classes and methods for interacting with the Lightning App Builder. -
wave Namespace
The classes in the Wave namespace are part of the Wave Analytics SDK, designed to facilitate quering Wave data from Apex code.