Versions Compared

Key

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

Pulsar currently supports running custom Pulsar Settings Language upon completion of a sync. This can be useful for recording the sync time, counting records, or alerting the user to new information. NOTE:  This trigger is tied to sync, and any data changes during this setting execution will be pushed to the Salesforce server, even if the user is forced offline permanently via settings.

Starting in Pulsar 6.0, this trigger will NOT process the following PSL Actions:

  • Create

  • CreateAndMapFields

  • Delete

  • Update queries in SqlQuery Actions

Instead, use the following PSL actions, both new in 6.0:

NOTE: These PSL actions push changes direct 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.

Here is a trivial example that displays the sync date/time upon a successful sync:

Name:  After Sync Trigger 
Key:     pulsar.sync.AfterSyncTrigger
ValuePulsar Settings Language

Code Block
DEFAULT{
Action=SetVar;
VarName=LastSync;
VarValue=@@LastSyncTime;
|
Action=Alert;
Message=Last successful sync time: %%LastSync%%;
}

Here is a bit more complicated example that displays the sync date/time upon a successful sync:

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=NoAction;
}

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

NoAction{
}