Professional Documents
Culture Documents
Validation Rules
Validation Rules
-------------
There will weather the format of the data that given the field is
compatable with your business requirement or not .
There validation rules are verified when we create a new record or update the
existing record
1. System Validations
2. Custom Validations
==> validation rule checks the condition if the given condition is true
then it prints the custom error message defined by the user
Example :
Object : Loan
Setup
|--->Build
|--->Create
|----->objects
|------Loan
|---Validation Rules
|----Rule
Example 2:
Object : Loan
Rule : If Security is Assert then assert cost field cannot be null
AND (
ISPICKVAL(Security__c,'Assert'),
ISNULL(AssertCost__c)
Object : Loan
Validation : AND(
ISPICKVAL(Security__c,'Salary'),
ISNULL(salary__c)
)
Example 4:
-----------
Object : Contact
Validation: AND (
ISNEW() ,
ISBLANK(AccountId)
)
========================================================================
ISCHANGED(fieldName) : This function returns true if the value in
Object :Opportuntiy
Rule : When ever the amount field value is nodified new value should
be more than the old value
Validation :
AND (
ISCHANGED( Amount) ,
Validation Error : Old version of value should not be more than the
new Value
----------------------------------------------------------------------
Example 6:
Object :Account
AND(
ISPICKVAL(Industry,'Energy'),
ISNULL(AnnualRevenue)
)
-------------------------------------------------------------------
Example 7:
Object : Account
AND(
ISCHANGED(AnnualRevenue) ,
AnnualRevenue< PRIORVALUE(AnnualRevenue)
)
--------------------------------------------------------------------
Example 8:
-------------
Object Loan :
OR(
AND(
ISPICKVAL( Loan_Type__c ,'Education') ,
ISPICKVAL( Loan_Type__c,'Housing') ,
------------------------------------------------------------------------