...
BeforeView (available in 14.0+)
BeforeEdit
BeforeSave
BeforeDelete
OnCreate
OnSave
OnDelete
onBarcodeScan
AfterSave (similar to OnSave, but is only run when the online save has been successfully pushed to Salesforce)
Validation Rules and Trigger execution points are composed of three four "post-action" execution points, OnCreate, OnSave, AfterSave, and OnDelete, where the create, save, or delete action has occurred or is certain to occur, and four "pre-action" execution points, BeforeView, BeforeEdit, BeforeSave, and BeforeDelete, where conditions can be validated before the actions occur. The differences between Validation Rules and Triggers actually have to do with the actions taken within the setting. Validation Rules will contain Alert actions that inform the user of a failed condition. Triggers will often update the current record or other records with no user interaction. Validation Rules and Triggers can be combined in Pulsar, and all of the logic for a particular object type and execution point can be contained in a single setting.
A Note about Save Triggers
To avoid issues with saving your data, we recommend not using the SyncNow action only with the AfterSave trigger and not with the BeforeSave or OnSave triggers. In fact, the primary use case for the AfterSave trigger is to be able to run a SyncNow action.
The difference between OnSave and AfterSave is that OnSave executes after a successful local write and always executes. The AfterSave trigger only executes after Pulsar sends the record create/update via an online write and has received a success response from Salesforce.
Usage
Pulsar Setting Format
...
Code Block |
---|
DEFAULT{ Action=SetResult; Result=Service Appointment viewing access denied.; ResultValid=false; } |
...
Example
...
Triggers
Name: On Save – Order Line Item
...
Code Block |
---|
DEFAULT{
Action=SetVar;
VarName=Order_Id;
VarValue=Order__c;
|
Action=SqlQuery;
QueryString=Select SUM ( CAST( Amount__c AS REAL ) ) AS SUM_ORDER_AMOUNT FROM Order_Line_Item__c WHERE Order__c = ‘%%Order_Id%%’;
QueryReturnFields=SUM_ORDER_AMOUNT;
|
Action=SqlQuery;
QueryString=Update Order__c SET Sub_Total__c = ‘%%SUM_ORDER_AMOUNT%%’ WHERE Id = ‘%%Order_Id%%’;
} |
Name: After Save - Service Report
Key: pulsar.afterSave.servicereport
Value: See the code below. The following example executes a single object sync in order to refresh the object and it’s related objects from Salesforce.
Code Block |
---|
DEFAULT{
Action=SetVar;
VarName=X;
VarValue=@@CurrentObject.ParentId;
|
Action=SyncNow;
SyncType="single";
RootObjectId=%%X%%;
} |
Special File Meta Object Usage for beforeSave and onSave
...