Skip to content

The Dml.Operation Enum

Jason Siders edited this page Aug 5, 2025 · 11 revisions

Enumerates all of the supported DML operations. The framework uses this in the Dml.Request class and the MockDml.ConditionalFailure interface to determine what type operation is being processed.

Example:

public class SomeLogic implements MockDml.ConditionalFailure {
  public Exception checkFailure(Dml.Operation operation, SObject record) {
    // Fail on update:
    return (operation == Dml.Operation.DO_UPDATE
    if (operation == Dml.Operation.DO_UPDATE) {
      return new System.DmlException();
    } else {
      return null;
    }
  }
}

Values

  • DO_CONVERT
  • DO_DELETE
  • DO_INSERT
  • DO_PUBLISH
  • DO_PURGE
  • DO_UNDELETE
  • DO_UPDATE
  • DO_UPSERT

apex-database-layer

Home

Core Concepts

Reference Guide

Migration Gudes

Clone this wiki locally