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
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) 
Steve :-/Steve :-/

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

Steve :-/Steve :-/

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!

Steve :-/Steve :-/

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!

Steve :-/Steve :-/

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