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
ZezoOneZezoOne 

Need help with a validation rule to make a checkbox req'd if certain picklist value is specified

Hi everyone...

This is prolly a fairly common newbie question, but I need to find out how I can make a checkbox required  if a value from a custom picklist is specified using validation rules.

Basically, I have a checkbox called "Pre_Traffic_IPID_c" and a picklist called "Tier_I_Site_c". I want to make it so that when a BD rep selects value=YES from "Tier_I_Site_c", the checkbox "Pre_Traffic_IPID_c" becomes required.

Here is the formula I am trying to use, but it doesn't seem to work:

AND ( Pre_Traffic_IPID__c , ISPICKVAL( Tier_I_Site__c , "YES"))

Can someone please give me a hand? (I suck at these things right now, so any and all help would be greatly appreciated)


ZezoOneZezoOne
**bleep** smilies....lol

ZezoOne wrote:

Basically, I have a checkbox called "Pre_Traffic_IPID_c" and a picklist called "Tier_I_Site_c". I want to make it so that when a BD rep selects value=YES from "Tier_I_Site_c", the checkbox "Pre_Traffic_IPID_c" becomes required.

Here is the formula I am trying to use, but it doesn't seem to work:

AND ( Pre_Traffic_IPID__c , ISPICKVAL( Tier_I_Site__c , "YES"))

Can someone please give me a hand? (I suck at these things right now, so any and all help would be greatly appreciated)





ZezoOneZezoOne
Let's try this ONE more time....

Code:
AND ( Pre_Traffic_IPID__c , ISPICKVAL( Tier_I_Site__c , "YES"))

 

KaushikKaushik
Hi
By making a check-box required,do you mean that the check-box has to be checked ,when the picklist points to YES
 
In that case your formula needs to include NOT
 
AND ( NOT(Pre_Traffic_IPID__c) , ISPICKVAL( Tier_I_Site__c , "YES"))
 
 
Hope this will help you out
 
Regards
ZezoOneZezoOne
Kaushik,

Many thanks for the quick response! That did the trick!

Thanks again!
DaibheidDaibheid
Hi!
 
I'm so glad I found this forum.  The solution above gave me enough to get the same general validation rule started, but mine is a bit more complex.
 
I have a picklist that if you select either "Turnkey", or "ESA", a checkbox called "Install BOM must be selected.
 
I've got that park working with the code below:
 
Code:
AND (NOT ( Install_BOM_Completed__c ), (OR(ISPICKVAL( Type, "Turnkey"), ISPICKVAL( Type, "ESA"))))

 
but I have a complication.  I don't care WHEN the box is checked, but it has to be checked before you can move from Stage 2 to Stage 3 in our "Stage" field.
 
Basically, if the box has to be checked, you can't move to stage 3 without it being checked.
ju6034ju6034

I have similiar question but its a reverse. I want it when on a recordtype, when someone checkmarks the field they must select a certain text from a picklist otherwise they cant save it. Thanks

NPMNPM

ju6034

Validation rules are evaluated when the record is saved.  It the validation formula evaluated to TRUE, the save is prevented and the error message is displayed.  If I undersatnd your requirement you want the save to be prevented if:  the record type is a particular value, and a checkbox field is checked, and a certain picklist value is not selected. If that is so a formula where all three conditions are true would be like this  

AND(

        RecordTypeID=nnnnnn,Checkboxfieldname,NOT(ISPICKVAL(Picklistfieldname,"Certain text"))
        )
 
 
ju6034ju6034

Thanks for the information, I tried it but i get a syntax error for a missing ')'. I tried adding the missing ) but for some reason I am not able to get it correct. Here is the formula below:

AND(

RecordTypeID=01270000000DgCU,X340B_Manager__c,NOT(ISPICKVAL(X340B_Eligibility__c,"340B Eligible,

Participating"  ))

)

I appreciate your help. Thanks
ju6034ju6034
Sorry ignore the question. I was able to figure it out. Thanks for your help again!
ju6034ju6034
I need help with creating a rather complex validation on an opportunity. Based on a recordtypeID, when the user picks a stage "assessed," the user has to pick between checkbox1 or checkbox2 or can pick both. Based on the checkbox selected there are 12 fields under checkbox1 or checkbox2 that need to have data inputted. Below are the three possible scenarios:
 
Scenario 1:
Stage = Assessed --> Checkbox 1 selected --> 12 fields under Checkbox 1 has to have data inputted.
 
Scenario 2:
Stage = Assessed --> Checkbox 2 selected --> 12 fields under Checkbox 2 has to have data inputted.
 
Scenario 3:
Stage = Assessed --> Checkbox 1 & Checkbox 2 selected --> 12 fields under Checkbox 1 & Checkbox 2 has to have data inputted.
 
The 12 field types under the checkboxes are below:
1. Number
2. Number
3. Currency
4. Checkbox
5. Currency
6. Text
7. Text
8. Checkbox
9. Text
10. Text
11. Checkbox
12. Checkbox
 
Any help or direction would be much appreciated. Thanks
NPMNPM
At first glance this looks like you will need 12 validation rules - one for each of the 12 fields - that check the record type, the condition of checkbox 1 and 2, and whether the field the rule is related to has data or not.  Once you get one that works you should be able to follow the pattern for the other 11 using functions that are applicatble to the field type. 
NPMNPM
And stage=assesssed
NPMNPM
That makes 14 rules - the other 2 are for the checkboxes when stage = assessed.
NPMNPM

I withdraw my comments.  go with Jakester who answered your duplicate post

http://community.salesforce.com/sforce/board/message?board.id=custom_formula&thread.id=2634