Configuring Real-Time Sync for Only Modified Work Order Fields
When real-time sync to Service Board is triggered by updates to Salesforce Work Order records, only the modified fields are synchronized. Platform events for Salesforce Work Ordervupdates include the modifiedFields section, which lists the names of updated fields. When Service Board receives this platform event, only these modified fields are synchronized. Computed field values that depend on other field values are listed in this section and synchronized as well. You can also configure real-time sync to synchronize additional fields when Salesforce Work Order field values are updated. This field-level synchronization is supported by two field mappings in the WorkOrder to Job Update Template transform template, _fields_dependency and _fixed_modified_fields.
The _fields_dependency mapping is preconfigured by default in the Field Mappings field of the WorkOrder to Job Update Template transform template to address cases where a single Service Board field maps to multiple Salesforce Work Order fields. For example, the core_address calculated field in Service Board maps to multiple Salesforce fields, as follows:
"core_address": "addressFormat(null, fields.SVMXC__Street__c, fields.SVMXC__City__c, fields.SVMXC__State__c, fields.SVMXC__Zip__c, fields.SVMXC__Country__c, fields.SVMXC__Latitude__c, fields.SVMXC__Longitude__c)",
When only one mapped Salesforce field, for example, SVMXC__Street__c, is updated and listed in the modifiedFields section of the platform event, to calculate and synchronize the updated value of core_address, its other mapped fields must also be included in real-time sync. The _fields_dependencyStarting from SVMXSB package versions 19.20011.14, 19.30003.11, and 20.10000.10, when real-time sync to Service Board is triggered by updates to Salesforce Work Order records, only the modified fields are synchronized. Platform events for Salesforce Work Order updates include the modifiedFields section, which lists the names of updated fields. When Service Board receives this platform event, only these modified fields are synchronized. Computed field values that depend on other field values are listed in this section and synchronized as well. You can also configure real-time sync to synchronize additional fields when Salesforce Work Order field values are updated. This field-level synchronization is supported by two field mappings in the WorkOrder to Job Update Template transform template, _fields_dependency and _fixed_modified_fields.
The _fields_dependency mapping is preconfigured by default in the Field Mappings field of the WorkOrder to Job Update Template transform template to addresscases where a single Service Board field maps to multiple Salesforce Work Order fields. For example, the core_address calculated field in Service Board maps to multiple Salesforce fields, as follows:
"core_address": "addressFormat(null, fields.SVMXC__Street__c, fields.SVMXC__City__c, fields.SVMXC__State__c, fields.SVMXC__Zip__c, fields.SVMXC__Country__c, fields.SVMXC__Latitude__c, fields.SVMXC__Longitude__c)",
When only one mapped Salesforce field, for example, SVMXC__Street__c, is updated and listed in the modifiedFields section of the platform event, to calculate and synchronize the updated value of core_address, its other mapped fields must also be included in real-time sync. The _fields_dependency JSON field mapping includes the dependent fields required to successfully calculate and synchronize this field value:
"_fields_dependency": [
[
"SVMXC__Longitude__c",
"SVMXC__Street__c",
"SVMXC__Country__c",
"SVMXC__Latitude__c",
"SVMXC__State__c",
"SVMXC__City__c",
"SVMXC__Zip__c"
]
]
* 
When field mappings defined in the Custom Field Mappings field that have dependencies upon other fields are updated, the _fields_dependency mapping is automatically added in the Custom Field Mappings field.
To manually configure dependencies between multiple fields, even if they are not included in the same field mapping, add iop_custom_fields_dependency in the _paras section as follows:
"_paras": {
"iop_do_not_duplicate_record_if_deleted": true,
"iop_custom_fields_dependency": [
[
"SVMXC__Priority__c",
"SVMXC__Problem_Description__c"
]
]
},
This value is automatically added to the _fields_dependency mapping, and then during real-time sync to Service Board, all of the fields in the iop_custom_fields_dependency mapping are processed if any are also in the modifiedFields section.
* 
When field mappings defined in the Custom Field Mappings field that have dependencies upon other fields are updated, the _fields_dependency mapping is automatically added in the Custom Field Mappings field.
The _fixed_modified_fields field mapping addresses cases where Process Builders that are configured for other applications update Salesforce fields that are mapped to Service Board. Due to Salesforce limitations, if multiple Process Builders are configured for the same object, execution order is nonconfigurable. If Process Builders that modify Salesforce Work Order fields run after the Process Builder for the Service Board Work Order object, the modified fields do not appear in the modifiedFields section of the relevant platform update event. To ensure that these fields are properly synchronized, you can configure _fixed_modified_fields in the Custom Field Mappings field of the WorkOrder to Job Update Template transform template.
To configure real-time sync for only modified work order fields:
1. In Max Designer, on the Developer Tools () launchpad menu, click Transform Templates, and then in the list view, click WorkOrder to Job Update Template.
2. On the Overview tab, in the Custom Field Mappings field, add mapping code for _fixed_modified_fields, for example:
"_fixed_modified_fields": ["SVMXC__Problem_Description__c" , "SVMXC__Priority__c"]
3. In the top left corner, click Save and Close (), and then on the Development Actions () launchpad menu, click Synchronize.
For more information:
Was this helpful?