Configuring Real-Time Sync for Actual Time Fields in Events
The Appointment object is configured with Actual Start Time and Actual End Time fields in Service Board. However, the corresponding fields are not configured for the Event and ServiceMax Event objects in Salesforce. If you have a business need to track scheduled versus actual times, you can add existing fields or custom fields to the Salesforce Event and ServiceMax Event objects to configure initial and real-time sync. In Salesforce, you can configure the Actual Start Time and Actual End Time fields for the Work Order, Event, or ServiceMax Event objects.
To configure real-time sync for Actual Time fields in Events:
1. In
Max Designer, on the
Developer Tools (
) launchpad menu, click
Transform Templates, and then in the list view, click
SFE to Appointment Create Template. 2. On the record page, in the
Custom Field Mappings field, add the following code, and then in the top left corner, click
Save and Close (
).
◦ If the Actual Start Time and Actual End Time fields on Salesforce are configured to include travel time to and from Events:
"svmx_actual_start_time": "ifelse(toBoolean(fields.IsAllDayEvent), isoDateFormat(fields.Actual_Start__c), dateAddSubtractFormat(fields.Actual_Start__c, fields.SVMXC__Driving_Time__c))",
"svmx_actual_end_time": "ifelse(toBoolean(fields.IsAllDayEvent), isoDateFormat(fields.Actual_End__c), dateAddSubtractFormat(fields.Actual_End__c, fields.SVMXC__Driving_Time_Home__c, false))",
◦ Otherwise:
"svmx_actual_start_time": "isoDateFormat(fields.Actual_Start__c)",
"svmx_actual_end_time": "isoDateFormat(fields.Actual_End__c)",
3. In the Transform Templates list view, click SFE to Appointment Update Template, and then on the record page, in the Custom Field Mappings field, add the same code as in the preceding step and save and close the record.
4. In the Transform Templates list view, click SME to Appointment Create Template, and then in the record page, in the Custom Field Mappings field, add the following code and save and close the record.
◦ If the Actual Start Time and Actual End Time fields on Salesforce are configured to include travel time to and from Events:
"svmx_actual_start_time": "ifelse(toBoolean(fields.SVMXC__IsAllDayEvent__c), isoDateFormat(fields.Actual_Start__c), dateAddSubtractFormat(fields.Actual_Start__c, fields.SVMXC__Driving_Time__c))",
"svmx_actual_end_time": "ifelse(toBoolean(fields.SVMXC__IsAllDayEvent__c), isoDateFormat(fields.Actual_End__c), dateAddSubtractFormat(fields.Actual_End__c, fields.SVMXC__Driving_Time_Home__c, false))",
◦ Otherwise:
"svmx_actual_start_time": "isoDateFormat(fields.Actual_Start__c)",
"svmx_actual_end_time": "isoDateFormat(fields.Actual_End__c)",
5. In the Transform Templates list view, click SME to Appointment Update Template, and then on the record page, in the Custom Field Mappings field, add the same code as in in the preceding step and save and close the record.
For more information: