Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

 

Admins can use Pulsar Settings to implement Validation Rules for the following execution points:

1. onCreate 

2. beforeEdit

3. beforeSave

4. onSave

5. beforeDelete

6. onDelete

The Validation Rules are defined using Pulsar Settings Language (PSL). The general format for such a setting is as follows:

Name: Object Name – execution point
Key: pulsar.<executionPoint>.<ObjectAPIName>
Value: Pulsar Settings Language

For example:
Name: Order - Before Edit
Key: pulsar.beforeEdit.Order__c
Value:  See the code below. This setting executes when the user tries to edit a record, and uses a query to determine if the user attempted to update a record that is already in status "Finalized" or "Cleared". 

DEFAULT{ 
Action=SetVar; 
VarName=Order_Id; 
VarValue=@@CurrentObjectId; 
| 
Action=SqlQuery; 
QueryString=SELECT Id FROM Order__c WHERE Id = '%%Order_Id%%' AND Status__c IN ('Cleared','Finalized'); 
QueryReturnFields=@@QueryCount; 
QueryTest=%%QueryCount%%=0; 
QueryTestTrue=SUCCESS; 
| 
Action=Alert; 
Message=Update is not allowed on Orders with status finalized, or cleared.; 
} 
SUCCESS 
{ 
}
  • No labels