What is the difference between insert() and database .insert()?

Submitted 3 years, 2 months ago
Ticket #336
Views 390
Language/Framework Other
Priority Low
Status Closed

Please explain?

Submitted on Feb 03, 21
add a comment

1 Answer

Verified

insert():

  1.   Partial insert and rollback is not supported.
  2.   If we use the DML statement (insert), then in bulk operation if error occurs, the execution will stop and Apex code throws an error which can be handled in try catch block.

database .insert():

  1.   Partial insert and rollback is supported.
  2.   If DML database methods (Database.insert) used, then if error occurs the remaining records will be inserted / updated means partial DML operation will be done.

Submitted 3 years, 2 months ago


Latest Blogs