Skip to content

The Plugin Framework

Jason Siders edited this page Jul 2, 2025 · 8 revisions

Apex Database Layer includes a mechanism to inject custom logic, or "plugins" in certain corners of the application. Use this plugin framework to make the framework your own!

💡_Have an idea for a new plugin? Create an issue._

How It Works

The framework includes a custom metadata type, Database Layer Setting / DatabaseLayerSetting__mdt.

Note: This object is optional - you do not need to create any records to enable the framework's core functionality.

To leverage the plugin framework, create a DatabaseLayerSetting__mdt record. There can only be one such record, and it must be called "Default":

image

Each plugin looks at field(s) in the Plugins section on the custom metadata record. For example, Dml.PreAndPostProcessor uses an apex class named in the DML: Pre & Post Processor field to perform its logic.

Currently Supported Plugins

  • Dml.PreAndPostProcessor: Defines logic to be run immediately before and/or immediately after a DML operation. Use this plugin for specialized logic, like logging, for example.
  • ⏳ More coming soon!

apex-database-layer

Home

Core Concepts

Reference Guide

Migration Gudes

Clone this wiki locally