function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chinuchinu 

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
Vinita_SFDCVinita_SFDC
Hi,

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

IF(NumberOfEmployees != Null AND Priorvalue(NumberOfEmployees )!= NumberOfEmployees )
balaji_SFDCbalaji_SFDC
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
chinuchinu
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..

chinuchinu
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.

Thanks!!
Vinita_SFDCVinita_SFDC
Hi,

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.
chinuchinu
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 ')'
Vinita_SFDCVinita_SFDC
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)
chinuchinu
Hi Vinita,

  Thanks for your reply...