DML Flashcards
Data Manipulation Language (15 cards)
What is DML?
Data Manipulation Language, abbreviated as DML, enable creating and modifying records in Salesforce.
DML Statements are operations that can act on one or many records. What are the available Operations?
Insert
Update
Upsert
Delete
Merge
Undelete
If DML Operations on multiple records fail, what happens?
An Exception is thrown.
Do standalone DML statements allow for partial success?
No DML statements do not but Database class methods can.
An Upsert will create a new record if none are matched and update if there is a match but what happens when multiple matches are found?
An Error is generated
How many records can be merged at a time?
Up to three records of the same sObject type.
What other options do we have for manipulating data other than our standard DML operations?
The Database class provides an alternative way for making record changes in the database as well as other methods.
Database Class methods can allow for partial processing, what does this mean?
If a record fails to update or insert, the rest of the batch can continue to process.
What does the ConvertLead Database Class Method do?
Converts a lead into a business account, contact, and opportunity (optional) by passing in lead records. A lead can also be converted into a business account and person account (instead of a contact) simultaneously if an org meets a required configuration.
What does the Database Class Method EmptyRecycleBin do?
Permanently deletes records from the Recycle Bin by specifying a list of sObject or recordIds, or an sObject.
What does the SetSavePoint Database Class method do?
Creates a savepoint variable for restoring the database to that point using the rollback method.
What does the RollBack Database Class Method do?
Restores the database to the state specified by a savepoint variable.
What does the ReleaseSavePoint Database Class Method do?
Releases a specified savepoint as well as the savepoints that were created subsequently or after that savepoint.
What Database Class methods are available for partial processing?
Insert
Update
Upsert
Merge
Delete
Undelete
Ex. Database.insert()