Posts

Showing posts with the label Salesforce DML and Database DML operations

Salesforce DML and Database DML operations

Image
                          DML & Database DML Operations 1. Standard DML Operations (insert, update, delete, undelete): These are the basic operations in Salesforce used to create, modify, or delete records. These operations are used in Apex to perform actions on Salesforce records. insert :     Used to insert new records into the database. // Insert a new Account record using DML  Account acc = new Account(Name = 'New Account');  insert acc; // Using DML insert update :   Used to modify existing records in the database. // Update an existing Account record using DML Account acc = [SELECT Id, Name FROM Account WHERE Name = 'New Account' LIMIT 1]; acc.Name = 'Updated Account Name'; update acc; // Using DML update delete :     Used to delete records from the database. // Delete an Account record using DML Account acc = [SELECT Id FROM Account WHERE Name = 'Updated Acc...