You need to sign in to do that
Don't have an account?

Help with--- Set a validation rule in a text field so that only numbers are allowed
Contract id is a text field but i wanted to accept only numbers only 11 digits allowed,i do NOT want to change the field type but the below validation rule solution works ,but how do i restrict so that it accepts only 11 digits,any other thoughts appreciated as well.. thanks
NOT(ISNUMBER( Contract_ID ))
ok i think i needed up 11 digits used >11 tor text-.>number ,thanks.
All Answers
Use the below one along with yours.
IF(LEN(Contract_ID) <> 11, FALSE,TRUE)
NOT(ISNUMBER( Contract_ID )),
LEN(Contract_ID) <> 11
)
If the value is not a number or has any other number of characters than 11, this validation will trigger.
ok i think i needed up 11 digits used >11 tor text-.>number ,thanks.
Sorry, Im not sure what you are trying to say. Do you mean you need "up to but no more than" 11 characters? So the number could be 9 characters or 10 or 5 or 11 but NOT 12 or more?
Ok with this validation rule
NOT(ISNUMBER(contract id)) ||
AND(ISNUMBER(contract id), LEN(contract id) >11)
i want to allow blanks,meaning i want to save the record with a value in this field
any thoughts?
note contract id is a text field with length 88 ,
"i want to allow blanks,meaning i want to save the record with a value in this field
any thoughts?"
This is a contradicting statement. Do you want to save blanks or values?
Also
NOT(ISNUMBER(contract id)) ||
AND(ISNUMBER(contract id)
contradict each other also.
Can you please state clearly what you want this validation rule to do?
Ok i want this field currently a text field to do 2 things
1)accept only numbers upto 11 digits AND
2)accept blank values
currently i cannot save the record without a value
This is what i did to solve the above problem
used the validation rule NOT(ISNUMBER(contract id)) ||
LEN(contract id) >10
and used the workflow rule to update whenever this field is saved blank .
NOT(ISNUMBER(contract id)) ||
LEN(contract id) >10
Does not do what you said in your second to last post that you want.
Please verify if all of these are true:
1. Contract ID can be saved blank
2. Contract ID can be a number up to but no more than 11 characters long
3. Contract ID can be a string of text with no limit of characters (up to the 88 character field max)
Hi there
NOT(ISNUMBER(contract id)) ||
LEN(contract id) >10
Does not do what you said in your second to last post that you want.
Please verify if all of these are true:
1. Contract ID can be saved blank
2. Contract ID can be a number up to but no more than 11 characters long
3. Contract ID can be a string of text with no limit of characters (up to the 88 character field max)
----------------------------------------------------------------------------------------------------------------------------------------
For the above question only #2 is satisfied with this validation rule ,# 3 is the Current field type Contract ID is TEXT(88) field type ,so # 3 is no longer required ,i hope this helps.
Hi ,IF # 1 and # 2 rule is satisfied i am OK ,# 3 is NO longer required.
AND(
NOT(ISBLANK(Contract_Id__c),
OR(
NOT(ISNUMBER(Contract_Id__c),
LEN(contract id) >11
)
)
This should throw an error if the field has a value and the value is not a number OR if the field has a value and the value is a number with more than 11 characters. Blank values will not throw an error.
Please test and confirm.