+ Start a Discussion

explicit 'COMMIT'



How to have an explicit 'COMMIT' in Apex?


In before update trigger we need to check a condition, and if that condition is satisfied the value of a field has to be changed and an error has to be thrown. As the transaction will be commited in the last, the changes to the field are not being saved as an error will be thrown.Hence a mechanism to commit the change to field before throwing the error. Is there any such mechanism in Apex.




Nope! Cannot explicitly commit.