[SalesForce] Validation rule is not working as expecting

Hi i got a requirement like create a validation rule based on probability.

The requirement is user cannot modify some custom field called forecast units If probability is under 70%

So, i write a validation rule like

AND(ISCHANGED( Forecast_Units__c ),Probability < 0.70)

It works fine but when i create any opportunity the validation doesn't work
can anyone help me

Best Answer

According to the docs

ISCHANGED function returns FALSE when evaluating any field on a newly created record.

So your validation will never fire when you are creating a record. You might want to add ISNEW() function which checks if you are creating a new record.

OR(
   AND(ISNEW(), NOT(ISBLANK( Forecast_Units__c )), Probability < 0.70),
   AND(ISCHANGED( Forecast_Units__c ),Probability < 0.70)
)
Related Topic