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
SakshiSakshi 

Help needed to write validation rule

Hi All,

I would like to add validation rule on one custom field.

Rule should validate inputs on following basis -

1. Value entered by user can be from 0 to 100 only.

2. Also value should be in multiple of 10 i.e. accepted value are as follows:
    0, 10, 20, 30, 40, 50, 60, 70,80, 90, 100
    

Can somebody help me to write validatation rule for this?

Thanks in advance

Sakshi G

skodisanaskodisana

Hi,

 

Instead of writing validation rule, Why don't you create filed with picklist data type with values from 0 to 100.

 

Thanks,

Kodisana

SakshiSakshi

Thanks for your suggestions.

 

I'm also thinking of that. But problem will be changing data type of column and lost of data.

 

Sakshi G

Pradeep_NavatarPradeep_Navatar

Write a Validation rule with this Error Condition :

 

 IF(MOD(TestNumber__c ,10) != 0, true, false)

 

And in the Error Message Field put text to show error message if it does not meet the above condition :

 

Incorrect Data - It should be in multiple of 10 i.e. accepted value are as follows: 0, 10, 20, 30, 40, 50, 60, 70,80, 90, 100

 

Hope this helps.

skodisanaskodisana

Hi,

 

Create a new filed with picjlist data type and its values. Export the records from the Object using Dataloader.

While importing Map the Text filed with custom picklist field.

 

Thanks,

Kodisana