Configuring Salesforce-to-Service Board Real-Time Sync for Object Undeletion
By default, real-time sync support 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 Undelete event for objects.
To configure Salesforce-to-Service Board real-time sync for object undeletion:
1. 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.
2. Create a trigger for the Undelete event. The following Apex code examples show triggers for the Account object.
trigger SB_Account_UnDelete_Trigger on Account (after undelete) {
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 && trigger.isAfter){
SB_Custom_IntegrationHelper intHelper = new SB_Custom_IntegrationHelper();

if(trigger.isUndelete){
intHelper.preparePlatformEvent('undelete', 'Account', trigger.newMap);
}
}
}
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, Account Undelete Template.
Identifier
Any unique identifier, for example, account_core_account_undelete.
Mapping Object
The custom object for which you are configuring real-time sync, for example, Account.
Action
Undelete
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
{
"undelete_Account": [
{
"id": "account_core_account_undelete"
}
]
}
For more information:
Was this helpful?