Configuring Trigger Broker Settings
What Are Trigger Broker Settings?
TriggerBrokerEventSettings__mdt
is a metadata type used to control the behavior of the Trigger Broker Framework. It allows admins to specify:
- Which objects are monitored.
- What types of events (Insert, Update, Delete, Undelete) are supported.
- Whether JSON payloads of record states should be included.
Why Are They Important?
Trigger Broker Settings give admins the flexibility to enable or disable event publishing without modifying code, ensuring automations align with changing business needs.
How to Configure Them
- Create a New Trigger Broker Setting:
- Go to Setup > Custom Metadata Types > TriggerBrokerEventSettings__mdt.
- Create a new record with the following fields:
- SObjectType__c: The API name of the object (e.g.,
ContentDocumentLink
). - OnInsert__c, OnUpdate__c, OnDelete__c, OnUndelete__c: Enable the trigger event types you need.
- IsActive__c: Check this to activate the setting.
- IncludeJSON__c: Check this if you need JSON representations of old and new record states.
- SObjectType__c: The API name of the object (e.g.,
- Test and Deploy:
- Test your configuration to confirm that platform events are being published.
- Deploy the configuration to production.
Best Practices
- Enable only the event types required to avoid unnecessary processing.
- Use descriptive names for metadata records for easy identification.
- Test thoroughly in a sandbox before deploying to production.