Declutter Setup Custom Metadata Type
Upon installation of the Email Scrubber application, default configuration for the ‘Declutter Setup’ is enabled. It can be found in the Salesforce Setup menu under Custom Metadata Types. The purpose of this Custom Metadata Type (CMDT) is to set some of the high-level configuration options of the application.
Note: If you are an existing Email Scrubber client upgrading to the most recent version, you will need to specifically add new fields to the CMDT layout.
​
Note: Not all the configuration options are required for your specific implementation. These are all outlined here to give you an understanding of the various options.
To view or modify the existing setup, follow the steps below:
​
-
From the Salesforce Classic User Interface
-
In the top right-hand corner, click Setup
-
In the Quick Find/Search box in the left-hand navigation pane, type “Custom Metadata Types”
-
Click on Custom Metadata Types under the Build 🡪 Develop folder
-
-
From the Lightning User Interface
-
Click the small Gear icon in the top right-hand corner and click Setup from the dropdown menu
-
From the Quick Find box in the left-hand navigation pane, type “Custom Metadata Types”
-
Click on Custom Metadata Types under the Custom Code folder
-
-
Click Manage Records next to ‘Declutter Setup’
-
You will then be presented with the configuration options for the default setup

Label (Master Label)
The out-of-box configuration will have a value of “Default”
Label (Master Label)
The out-of-box configuration will have a value of “Default”
Declutter Setup Name (DeveloperName)
This will default to the same value set in the ‘Label’ field
isActive
Indicates that the Custom Metadata Type is Active or not.
Duplicate DateTime Detected Field Name (Optional)
​The default Email Scrubber functionality sets the EmailScrubber__duplicate_detected__c field to true when a duplicate is found. This configuration setting allows for an additional EmailMessage field to be set to store the DateTime the duplicate detected was discovered. To leverage this functionality, populate the api field name on the EmailMessage object which should contain the datetime. Note: This field can be used for reporting or filtering when running batches.
Duplicate Detected Field Name (Optional)
The default Email Scrubber functionality sets the EmailScrubber__duplicate_detected__c field to true when a duplicate is found. This configuration setting allows for an additional EmailMessage field to be set to store a string value of “TRUE” when a duplicate is detected. To leverage this functionality, populate the api field name on the EmailMessage object which should contain the string. Note: This field can be used for reporting or filtering when running batches.
Trigger is Active (Case Email Message)
Identifies the action to take if the trigger is active and redundant emails messages are identified. Flag sets emailmessage.duplicate_detected__c to true.
Trigger Action
Identifies the action to take if the trigger is active and redundant emails messages are identified. Flag sets emailmessage.duplicate_detected__c to true.
Retro Batch Where Condition
​Identifies the Where condition to execute against email messages when the Retro Batch is executed. Use this to limit the batch as needed.
Retro Batch Action
Identifies the action to take if the trigger is active and redundant emails messages are identified. Flag sets emailmessage.duplicate_detected__c = true. Purge will immediately delete the duplicate record.
Purge Batch Where Condition
Identifies the Where condition to execute against email messages when the Retro Batch is executed. As an additional precaution, only records with emailmessage.duplicate_detected__c = true are processed by the batch.
Purge Batch Attachments Action
Identifies the action to take on the email attachments after the email message records has been purged.
Purge Batch Attachments Save Audit
Identified how the audit fields (createdby, createddate, lastmodifiedBy, lastmodified) should be set when new email attachments are created. If checked, the original values will be preserved. NOTE: The running user must have this permission.
Archive Batch Where Condition
Identifies the Where condition to execute against email messages for native archiving. This query should contain “duplicate_detected__c = true” if wishing to archive only redundant email messages. If this archiving is being used without redundant segmentation, enter your own filtering logic shuck as parent.isClosed = true.
Archive Batch Destination
Choose Redundant History (Recommended) or Big Objects. Redundant History will leverage a custom related object. Big Objects will leverage the Big Objects storage solution.en purged.
Archive Batch Attachments Action
Identifies the action to take on the email attachments after the email message records has been purged.
Archive Batch Attachments Save Audit
Identifies how the audit fields (createdby, createddate, lastmodifiedBy, lastmodified) should be set when new email attachments are created. If checked, the original values will be preserved. NOTE: The running user must have this permission
First Incoming Batch Where Condition
​Idntifies the Where condition to execute against email messages to set the first_incoming__c on the Email Message. Note: The batch will identify the first incoming = true that exists on the case at run time. In the event email messages have been purged, and the batch runs, the earliest record where incoming = true is set will be flagged.