Skip to content

The Plugin Framework

Jason Siders edited this page Jul 13, 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.

  • Soql.PreAndPostProcessor: Defines logic to be run immediately before and/or immediately after a SOQL operation. Use this plugin for specialized logic, like logging, for example.

Clone this wiki locally