You need to sign in to do that
Don't have an account?
Checking percentage field for 100% - not working
Hi,
Tearing my hair out over this one. I need a simple validation rule to check that a percentage field's value is <> 100%.
This is my rule:
Percentage_Complete__c = 100
This is the result from the debug log when the field has value of 100
20:12:51.054 (54955000)|VALIDATION_FORMULA|Percentage_Complete__c = 100|Percentage_Complete__c=100
20:12:51.054 (54963000)|VALIDATION_PASS
And when the value is 90
20:23:47.056 (56888000)|VALIDATION_FORMULA|Percentage_Complete__c = 100|Percentage_Complete__c=90
20:23:47.056 (56903000)|VALIDATION_PASS
How can it pass with both 100 and 90?
But if I change the rule to:
Percentage_Complete__c < 100
When the value is 100 this is the result
20:27:47.075 (75783000)|VALIDATION_FORMULA|Percentage_Complete__c < 100|Percentage_Complete__c=100
20:27:47.075 (75798000)|VALIDATION_FAIL
I get this when the value is 90
20:26:25.055 (55444000)|VALIDATION_FORMULA|Percentage_Complete__c < 100|Percentage_Complete__c=90
20:26:25.055 (55456000)|VALIDATION_FAIL
Again how can this fail with both 100 and 90?
Any help will be much appreciated.
Thanks
Derek
53048
Thanks for the replies. But I actually managed to fix this myself (after spotting a relevant comment in another post).
In validation rules the value of a percentage field is expresses as 1 for 100%, 0.9 for 90% and so on.
Therefore the correct syntax for the rules in question is:
Percentage_Complete__c = 1
All Answers
May be you need to do "==" instead of "=" ?
First one is comparison operator and second one is assignment. So rule should be
Thanks for the replies. But I actually managed to fix this myself (after spotting a relevant comment in another post).
In validation rules the value of a percentage field is expresses as 1 for 100%, 0.9 for 90% and so on.
Therefore the correct syntax for the rules in question is:
Percentage_Complete__c = 1
That is what I was going to come back with if you said that it was a Percentage field.