This course is currently a work in progress. Please join the waitlist to receive regular updates.
Database Manipulation Language (DML)
In Apex, DML stands for Data Manipulation Language, and it allows developers to create, update delete records in the salesforce database. Following are the different types of DML operations that can be performed in apex.
Apex is tightly integrated with Salesforce's database, so you can use DML statements to interact with both standard and custom objects. However, it's important to be mindful of Salesforce's governor limits to ensure your code runs efficiently.
To stay within these limits, always aim to use bulk operations wherever possible, as they help minimize the number of DML statements used. Below are the governor limits for database transactions in Apex.
Type | Limit | Description |
---|---|---|
DML Statements | 150 | The maximum number of DML statements (insert, update, delete, upsert) that can be executed in a single transaction. |
Total number of records. | 10,000 | Total number of records processed as a result of DML statements,Approval.process, or database.emptyRecycleBin |