You need to sign in to do that
Don't have an account?
Avinash Angasay
related with dml
Q-> Insert 100 student’s records. Rollback all the inserted records if the number of successful insertion is less than 80
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Please follow below code, it's not tested So please try it
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
All Answers
Please follow below code, it's not tested So please try it
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Apex gives you the ability to generate a savepoint in a scenario like yours, that is, a point in the request that specifies the state of the database at that time. Any DML statement that occurs after the savepoint can be discarded, and the database can be restored to the same condition it was in at the time you generated the savepoint.
See official doc: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_transaction_control.htm
Sample code that you could customize as per your need: Reference: https://salesforce.stackexchange.com/questions/9410/rolling-back-dml-operation-in-apex-method
If this information helps, please mark the answer as best. Thank you