Configuring Salesforce-to-Service Board Real-Time Sync for Custom Object Deletion
By default, real-time sync support for custom objects from Salesforce to Service Board is handled by process builders that support only the Create and Update events. Therefore, you must complete the following steps to configure real-time sync support for the Delete event for custom objects.
To configure Salesforce-to-Service Board real-time sync for custom object deletion:
1. For tenants with installed Service Board Extension package versions earlier than 21.99113, in Salesforce, create the SB_PBSecurityUtils and SB_Custom_IntegrationHelper Apex classes if needed. For more information, see Configuring Salesforce for Service Board-to-Salesforce Real-Time Sync for Custom Objects.
For package versions 21.99113 and later, skip this step and continue with step 2.
2. Create a trigger for the Delete event.
The following Apex code examples show triggers for a custom object with the API name Custom_Object__c.
Delete Event for package versions earlier than 21.99113:
trigger SB_Custom_Object_Delete_Trigger on Custom_Object__c (after delete) {
Map<string,String> mapSettings = new Map<String,String>();
mapSettings = (new SVMXC.COMM_Utils_ManageSettings()).SVMX_getGlobalSettingList(new List<String>{'DCON007_SET001', 'DCON007_SET003'});
system.debug(loggingLevel.WARN, 'mapSettings DCON007 = ' + mapSettings);

Boolean isServiceBoardEnabled = false;
if(mapSettings.containsKey('DCON007_SET001') && mapSettings.get('DCON007_SET001') != null) {
isServiceBoardEnabled = Boolean.valueOf(mapSettings.get('DCON007_SET001'));
}

if(isServiceBoardEnabled){
SB_Custom_IntegrationHelper peHelper = new SB_Custom_IntegrationHelper();
peHelper.preparePlatformEvent('delete', 'Custom_Object__c', trigger.oldMap);
}
}
Delete Event for package versions 21.99113 and later:
trigger SB_Custom_Object_Delete_Trigger on Custom_Object__c (after delete) {
SVMXSB.SB_ProcessBuilderHelper.prepareDeletePE('delete', 'Custom_Object__c', trigger.oldMap);
}
3. In Max Designer, on the Developer Tools () launchpad menu, click Transform Templates, and then in the list view in the top left corner, click Create ().
4. Create a transform template with the following field values.
Field
Value
Name
The name you want to use for the template, for example, Custom Object Create Template.
Identifier
custom_object_remove_template
Mapping Object
The custom object for which you are configuring real-time sync, for example, Custom Object.
Action
Delete
Field Mappings Operation
SFDC Namespace Transform
Field Mappings
{
"io_uuid": "concat('external-', fields.Id)",
"io_updated_by": "concat('external-', systemFields.LastModifiedById)"
}
5. In Max Designer, on the Administration () launchpad menu, click Settings, and then in the list view, in the top left corner, click Create ().
6. Create a Setting record with the following field values, and then on the Development Actions () launchpad menu, click Synchronize.
Field
Value
Name
The name for the setting, for example, SFDC Real-Time Sync Customize Transform Rules.
Applicable Application
Service Board
Identifier
This value is fixed and noneditable, and is always sfdc_realtime_sync_customize_transform_rules.
Datatype
Code
Default Value
{
"delete_Custom_Object__c": [
{
"id": "custom_object_remove_template"
}
]
}
* 
The JSON in the Default Value field defines transform rules,. Rule syntax is delete_<SFDC Object API Name>, and values are case-sensitive. In the sample in the previous table, the rule for the Delete action is delete_Custom_Object__c.
For more information:
Was this helpful?