Activity Forums Salesforce® Discussions What is difference insert() and database.insert() in salesforce?

  • Shweta

    Member
    January 17, 2020 at 1:34 pm

    1. Insert :  If we use the DML statement insert  in bulk operation and if error occurs, the execution will stop,  and Apex code throws an error which can be handled in try catch block.
    2. Database.insert : If we use the DML database method ( Database.insert)  and if error occurs the remaining records will be inserted / updated. It means partial DML operation will be done.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos