Skip to content

Add Failed DMLs to a Dead Letter Queue #32

@volodiag

Description

@volodiag

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 :

  1. let the transaction fail (allOrNone = true) --> error can be managed by Catch(DMLException)
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions