Versions Compared

Key

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

 

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

...

For example:
Name: Order - Before SaveEdit
Key: pulsar.beforeSavebeforeEdit.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". 

Code Block
DEFAULT{ 
Action=SetVar; 
VarName=Order_Id; 
VarValue=Id; 
| 
Action=SetVar; 
VarName=SUM_ORDER_AMOUNT; 
VarValue=0@@CurrentObjectId; 
| 
Action=SqlQuery; 
QueryString=SelectSELECT SUMId ( CAST( AmountFROM Order__c ASWHERE REALId ) ) AS SUM_ORDER_AMOUNT FROM Order_Line_Item__c WHERE Order__c = '%%Order_Id%%'= '%%Order_Id%%' AND Status__c IN ('Cleared','Finalized'); 
QueryReturnFields=SUM_ORDER_AMOUNT@@QueryCount; 
QueryTest=%%SUM_ORDER_AMOUNT%%>50=%%QueryCount%%=0; 
QueryTestTrue=SUCCESS; 
| 
Action=Alert; 
Message=Minimum order amount should be greater than $50Update is not allowed on Orders with status finalized, or cleared.; 
} 
SUCCESS 
SUCCESS{ 
}