Configuring the Retry Button
Real-time sync failures are logged in the Error Log field in the Queue Outbound record. You can create a Retry button in the record and expose it to the Queue Outbound object in Salesforce to easily rerun real-time sync.
To configure the Retry button:
1. On the Salesforce Setup page, in the left pane, in the Build area, in the Create node, click Objects.
2. On the Custom Objects page, click the SM_SB_Queue_Outbound object, and then in the Buttons, Links, and Actions section, click Create New Button or Link.
3. On the Custom Button or Link Edit page, complete the fields as follows.
Field
|
Value
|
Label
|
Retry
|
Display Type
|
Detail Page Button
|
Behavior
|
Execute JavaScript
|
Content Source
|
OnClick JavaScript
|
4. Add the appropriate code for your Service Board release version:
◦ Service Board 20.2 and later:
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}
var outboundRecordId = '{!SVMXC__SM_SB_Queue_Outbound__c.Id}';
var status = '{!SVMXC__SM_SB_Queue_Outbound__c.SVMXC__SM_Status__c}';
var eventType = '{!SVMXC__SM_SB_Queue_Outbound__c.SVMXC__SM_Event_Type__c}';
var sObjectRecordId = '{!SVMXC__SM_SB_Queue_Outbound__c.SVMXC__SM_Record_to_Dispatch__c}';
var objectName = '{!SVMXC__SM_SB_Queue_Outbound__c.SVMXC__SM_Object_Name__c}';
var payload = '{!JSENCODE(SVMXC__SM_SB_Queue_Outbound__c.SVMXC__SM_Payload__c)}';
sforce.apex.execute("SVMXSB.SB_SendFailedRecords", "retryFailedRecord", {outboundRecordId, status, eventType, sObjectRecordId, objectName, payload});
window.location.reload(true);
◦ Service Board 20.1 and earlier:
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}
var outboundRecordId = '{!SVMXC__SM_SB_Queue_Outbound__c.Id}';
var status = '{!SVMXC__SM_SB_Queue_Outbound__c.SVMXC__SM_Status__c}';
var eventType = '{!SVMXC__SM_SB_Queue_Outbound__c.SVMXC__SM_Event_Type__c}';
var sObjRecordId = '{!SVMXC__SM_SB_Queue_Outbound__c.SVMXC__SM_Record_to_Dispatch__c}';
var result = sforce.apex.execute("SVMXSB.SB_SendFailedRecords", "sendFailedRecord", {outboundRecordId, status, eventType, sObjRecordId});
window.location.reload(true);
5. Save the record, and then navigate to the Edit Page Layout page for the Outbound Queue object and expose the newly added button to the layout.
For more information: