When doing a DML, it often happens that the DML fails because of some data validation (validation rule, adderror, error thrown in apex, etc ...). There are 2 ways to handle those :
- let the transaction fail (allOrNone = true) --> error can be managed by Catch(DMLException)
- carry on the transaction with successful records (allOrNone = false) --> error can be managed by SaveResult
Typically, (1) would stop transaction runtime and let an error message in the UI display and (2) would carry on the transaction and log the error message details (ex. using Nebula Logger).
What I wish to exist is a capability where, in the case of (2), the record submitted for failed DML is saved (persisted) as a record and there would be a capability to edit (fix) the record and re-submit the DML. To make this capability possible, we would need the following :
- details on the DML operation (insert, update, ...)
- snapshot of record details
- error message
If I am not mistaken, all these information are accessible in one single location through this framework.
When doing a DML, it often happens that the DML fails because of some data validation (validation rule, adderror, error thrown in apex, etc ...). There are 2 ways to handle those :
Typically, (1) would stop transaction runtime and let an error message in the UI display and (2) would carry on the transaction and log the error message details (ex. using Nebula Logger).
What I wish to exist is a capability where, in the case of (2), the record submitted for failed DML is saved (persisted) as a record and there would be a capability to edit (fix) the record and re-submit the DML. To make this capability possible, we would need the following :
If I am not mistaken, all these information are accessible in one single location through this framework.