You need to sign in to do that
Don't have an account?
nickfs92840
Validation Rule where 1 or more is required
Have a field name: Number of Facilities
API Name: Number_of_Facilities__c
The field is currently set to required, so user must enter a value.
However, I don't want a user to enter 0, as I would want a value greater than 1 to be entered in this field.
This is my current validation rule, but if I enter 0 in the field, the records still saves:
AND(ISNULL(Number_of_Facilities__c), (Number_of_Facilities__c < 0.01))
Can someone look at my validation rule and see where I am wrong?
Thanks!!!!!
my bad, here you go
All Answers
Try this
Hi Stevemo,
It didn't work. I entered 0 and I was able to save the record. :smileysad:
my bad, here you go
Hi Stevemo,
That one didn't work either. I had tried that combination at one time too. Can it be something else I have set incorrectly?
Really? I just tested it on my DE Org and it worked. What is the datatype of the number field that you are trying to evaluate, does it have any decimals?
has no decimals
http://www.harmonynewtechnologies.com/salesforce/ndhce/ndhce01.png
try this link
I think your Default Value 1 is what's messing you up, clear that out and give it a shot
I removed the default value and also the requirement and still nothing. :smileysad:
Just to make sure that I understand, you want the user to enter a value of 1 or greater in the field? Can you post the exact VR Formula that you are using?
Yes, enter 1 or equal of 1 or great than 1...so, user can enter 1 or anything greater than 1
This is the exact VR code entered:
And here is a screenshot of the VR window: http://www.harmonynewtechnologies.com/salesforce/ndhce/ndhc02.png
Hi Nick,
I can't recreate the problem on my DE Org, can you post a screenshot of a record that should be triggering the VR, but is not?
Also, I notice in the description of your VR you're saying that the user must enter a value GREATER than one, but in your earlier post you said that then number must be AT LEAST 1. Which one is correct?
Hey Stevemo
Yes, the user can enter 1 or anything greater than 1. The default is 1 But if you enter 0, the record still saves.
There is no other trigger but here is screenshot of the fields on the object (blurred out the field names)
http://www.harmonynewtechnologies.com/salesforce/ndhce/hdce03.png
Steve!
I figured it out!
Your formula
was always correct! :)
Thank you once again!!
I have a doubt.
If the field is mandatory in page layout or field level, why ISBLANK(Number_of_Facilities__c) is used in the validation rule?
Its irrelevant right?
@abhi_the1
you are right, the requirement is not required for this formula to work. Upon removing the requirements for the "number of facilities" and noticing there were numerous requirements on the object itself, the other required fields were populated with data, and the "Number of Facilities" was left blank or with a 0, the validation rule did work and produced an error.
Stevemo's VR formula is correct regardless.