...
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=SqlQuery;
QueryString=SELECT CASE WHEN CAST('%%AppVersion%%' AS INT) < 6 THEN 0 ELSE 1 END AS ReturnVal;
QueryReturnFields=ReturnVal;
QueryTest=%%ReturnVal%%=0;
QueryTestTrue=Update_User_5.0;
QueryTestFalse=Update_User_6.0;
}
Update_User_5.0{
Action=SqlQuery;
QueryString=UPDATE User SET LastSuccessfulPulsarSync__c = '%%LastSync%%' WHERE Id ='%%CurrentUserId%%';
}
Update_User_6.0{
Action=SFUpdate;
ObjectType=User;
Id=%%CurrentUserId%%;
LastSuccessfulPulsarSync__c=%%LastSync%%;
} |