+ Start a Discussion

Help me with validation rule...

Hi all,
Null value field can be stored by number & if the field already contains number then it cannot be replaced with any number.If the field contain  number and it is replaced with any digit then it should thrown an error

Suppose the field name is employeeNumber then you can have validation rule like:

IF(NumberOfEmployees != Null AND Priorvalue(NumberOfEmployees )!= NumberOfEmployees )
Hi Chinu,

Use the ISCHANGED() Function.

Syntax:ISCHANGED(Custom Filed API name)

If you enter any number after saving the record it throws error.

Is it helpful mark it as a best answer
Hi Vinita,

Thanks for answering & Please let me know how exactly i have to give validation rule.

When im giving the validation rule which you have given its throwing error when i will cliick on check syntax..

Hi venkatesh,

Please let me know how to give ISCHANGED function.

Requirement: When the record is created if the field value is null then the record is saved & if we edit record & given any digit then the record has to be saved.But now if we edit the record and given number for second time it has to throw an error.


Have you replaced name of the field with concerned custom field, can you share what validation rule did you try and what error you got.
Hi vinita,

I have created NumberOfEmployees field and trying by given below validation.
 IF( NumberOfEmployees__c  != Null AND Priorvalue( NumberOfEmployees__c  )!=  NumberOfEmployees__c  )

Its throwing the error like below:
Error: Syntax error. Missing ')'
Yes, the syntax is wrong. If you click on help while writing IF function, you would have got it.

Try this:

IF( NumberOfEmployees__c  != Null AND Priorvalue( NumberOfEmployees__c  )!=  NumberOfEmployees__c, 1, 0)
Hi Vinita,

  Thanks for your reply...