function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sree SalesforceSree Salesforce 

salesforce Unit of Work Principles ,how uow.commitWork willl work ?


1) is it a parital insert or update  (or) is there any error occurs while doing insertion is it revort back?
2) i have thres lists 
  ->a (parent)
 -->b (child)
 -->c (child)
how it will work when i commit?
NagendraNagendra (Salesforce Developers) 
Hi Sri,

Are you referring to committing it via Apex? It looks like you are referring to a method at the end there.
It might be better asked in the developer forums.
(https://developer.salesforce.com/)

Quick answer if Apex, the following will only Insert/Update successful records, and skip errors:
Database.Insert(ListName, false)
Replace Insert with Update if doing an update. False refers to allOrNone parameter

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_database.htm

Hope this helps.

Regards,
Nagendra.