Versions Compared

Key

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

...

If you are using forced offline permanently setting, you may want to use the following actions to send the sync stats to Salesforce.

NOTE: The SFCreate and SFUpdate PSL actions push changes direct directly to Salesforce and will NOT update the local Pulsar database. Any creates and updates using these actions will need to be synced to Pulsar at a later time.

Otherwise, you can use these PSL actions that write to the local database as well.

...

Here is a bit more complicated example that displays updates the sync date/time upon a successful syncuser 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%%;
}

NoAction{
CreateError{
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

Panel
panelIconIdatlassian-info
panelIcon:info:
panelIconText:info:
bgColor#F4F5F7

Visit the following related pages for more information about this topic: