Salesforce Fact #73 | Save your work
We can use savepoints to return to a previous state in the transaction.
In this example, we are inserting list of Accounts and Contacts in the try block. For some reason if contact insert fails, we want to rollback the account inserts also. For this we can use savepoint.
Attached is the screenshot.
Comments
Post a Comment