Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here is a bit more complicated example that displays updates the sync date/time upon user record with sync details on a successful sync, and creates an error record and attaches logs if the sync fails:

Code Block
DEFAULT{
Action=SetVar;
VarName=LastSync;
VarValue=@@LastSyncTime;
|
Action=SetVar;
VarName=CurrentUserId;
VarValue=@@CurrentUserId;
|
Action=SetVar;
VarName=AppVersion;
VarValue=@@AppVersion;
|
Action=SetVar;
VarName=LastSyncSuccess;
VarValue=@@LastSyncSuccess;
|
Action=SqlQuery;
QueryString=SELECT CASE WHEN '%%LastSyncSuccess%%' = 'TRUE' THEN 1 ELSE 0 END AS SyncSuccess;
QueryReturnFields=SyncSuccess;
QueryTest=%%SyncSuccess%%=1;
QueryTestTrue=UpdateUser;
QueryTestFalse=NoActionCreateError;
}

UpdateUser{
Action=SFUpdate;
ObjectType=User;
Id=%%CurrentUserId%%;
LastSuccessfulPulsarSync__c=%%LastSync%%;
}

NoActionCreateError{
Action=SFCreate;
ObjectType=Sync_Error__c;
AffectedUser=%%CurrentUserId%%;
AppVersion__c=%%AppVersion%%;
SyncFailureDateTime__c=%%LastSync%%;
AttachLogs=TRUE;
}

Full List of Sync Stat Values

@@AppVersion
@@PreviousSyncTime
@@LastSyncSuccess
@@LastSyncTime
@@LastSyncDuration
@@LastFailedSyncTime
@@LastFailedSyncDuration
@@LastFailedSyncErrorCode
@@LastFailedSyncCurlErrorCode
@@LastFailedSyncCurlErrorMessage
@@LastFailedSyncSfErrorCode
@@LastFailedSyncSfErrorMessage
@@LastFailedSyncHttpResponseCode
@@LocalCreatedCount
@@LocalDeletedCount
@@LocalUpdatedCount
@@LocalUpdatedUniqueCount
@@ServerProcessedCount
@@ServerProcessedObjectCountMap
@@ServerIntegratedCount
@@SyncDomainType
@@SyncWindowType
@@SyncResumed
@@SyncPassCount
@@SchemaChanged
@@SyncGeneration
@@MetadataSyncPerformed
@@MetadataSyncDuration
@@ReachabilitySyncPerformed
@@ReachabilitySyncDuration
@@RefreshPerformed
@@RefreshDuration

...