+ Start a Discussion
manliamanlia 

How to make a field required based on a boolean field (checbox)?

Hi,

 

I thought this is a simple thing to just add the validation rule when "field1_c <> False" in the condition formula.

However, it's not working for me.  It seems that it ignores the data that is already entered in that required field.  The validation rules error keeps popping up.

 

I'd like to have the  "currency" type field required when the "checkbox" field is enabled (True).

How do you set this in the validation rule?

 

Thanks,

Lia

Best Answer chosen by Admin (Salesforce Developers) 
SteveMo__cSteveMo__c

Okay, if you want to make sure that the Currency field is not blank (empty) then you can do this

 

AND((Checkbox_1__c ),ISBLANK( Amount_1__c ))

If you need to make sure that they enter an amount > $0.00 then you need something like this

 

AND((Checkbox_1__c ), Amount_1__c < 1)

 

 

 

 

All Answers

SteveMo__cSteveMo__c

What is the datatype of the Currency field?

manliamanlia

The data type is "currency".

manliamanlia

The data type for the required field is "currency".

The data type for the validation rule field is "checbox" (true or false).

 

This is what I'm trying to achieve:

When "checkbox" is True, the "currency" field is required.\

 

Thanks again!

SteveMo__cSteveMo__c

Okay, if you want to make sure that the Currency field is not blank (empty) then you can do this

 

AND((Checkbox_1__c ),ISBLANK( Amount_1__c ))

If you need to make sure that they enter an amount > $0.00 then you need something like this

 

AND((Checkbox_1__c ), Amount_1__c < 1)

 

 

 

 

This was selected as the best answer
manliamanlia

Thank you so much!  That works!

SteveMo__cSteveMo__c

No problem, you owe me a beer!

http://beeradvocate.com/beer/profile/863/7971

 

Anisha BhaktaAnisha Bhakta
Hi Steve!

I was wondering how you would apply this formula if you wanted to check a boolean field against  multiple fields like address, city, zip, country. 

Specifically my issue is I do not want our sales rep to send an account to our ERP (Boolean field) if the address, city, zip, country (Text fields) are not populated.

I have this VR so far, but if I try to add additional address fields after ISBLANK it will throw back an error on check syntax.
 AND((Send_to_NAV__c), ISBLANK(BillingAddress))

Any help would be greatly appreciated. :)

Thanks!

- Anisha B