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
InternIntern 

Validation Rule

I would like to create a validation rule for a custome % field.  I would like my employees to be able to only enter 0, 25, 50, 75, 90, or 100, and receive an error message whenever they enter any other number.
My error message will then appear and state "please select 0%, 25%, 50%, 75%, 90%, 100%.
 
How do i do this.
 
I tried:                Probability_Funding__c <> 5            *that would be one validation rule, and then i made more validation rules to cover all the numbers from 5 to 95 going by fives exept for the numbers i need.  But the validation rule ended up giving me an error no matter what number i put it, 25, 55, or 19 nothing works.
 
 
TCAdminTCAdmin
Hello Intern,

One thing that you need to remember with Percentage fields is that it doesn't use the whole number in the validation rule.  If you want them to enter the value 25% then you need to validate 0.25.  The formula below should work for you.  Let me know if you have any other questions.

AND(Percent__c <> 0.90, MOD(Percent__c, 0.25) <> 0)
InternIntern

Thank you,

Yes that validation rule worked perfectly.  I am still not sure of the thought process which would lead to creating it, but I am still new at creating these formulas.

I do have one more which I have been trying to figure out, it is a bit more complicated but if figure you may find a solution much faster then me.

I currently have a close date field (ex. 6/11/2008), then there is an amount field (ex. $657,240.00) and a Probability (%) field (ex. 50%).

Then there are 4 fields.  Q1(July-Sept.), Q2(Oct.-Dec.), Q3(Jan.-March), Q4(April-June)

The formula i want to make should multiply the amount field with the Percent (%) field and then take the date into consideration, and enter the number in the correct field.

So in this case it would be.  $657,240.00 * 50% = $328,620.00 on June 11, 2008

So field Q4(April-June) should have $328,620.00 next to it.

Your help would be greatly appreciated,

Thanks again.

MSheridanMSheridan

Do you have these 4 fields on your opportunity page layout as formula fields already? Until you create a formula, you can always use workflow rules as an alternate. Just a thought.

MSheridanMSheridan

Do you have these 4 fields on your opportunity page layout as formula fields already? Until you create a formula, you can always use workflow rules as an alternate. Just a thought.

MSheridanMSheridan
Try this formula for each field. Below is for the first quarter - July thru September. So you would create Q1 as a formula field with the below formula. Let me know if this works for you.
IF( OR(MONTH( CloseDate) = 7, MONTH( CloseDate)= 8, MONTH( CloseDate) = 9), Amount * Probability, null)