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
David Ji 6David Ji 6 

Need help with simple formula validation...

Hey guys,

I'm a real newbie and just can't seem to work. I am needing help writing this validation formula.

Basically, I want a checkbox to only be pressed TRUE if field A + field B + field C is not blank. The checkbox is not always used, so I want this validation to only work when I try to save the record with the checkbox as TRUE.

I tried:

OR(
ISBLANK(fieldA),
ISBLANK(fieldB),
ISBLANK(fieldC))

And this worked, except I can't save the records at all even if the checkbox is NOT ticked...



So I then tried 3 different validation rules separately:

1. 
AND(
     checkbox = TRUE,
     ISBLANK(fieldA)

2. 
AND(
     checkbox = TRUE,
     ISBLANK(fieldB)

3.
AND(
     checkbox = TRUE,
     ISBLANK(fieldC)

This one worked, but it doesn't work together, when I enter value for fieldA and click checkbox, it works and doens't validate the other rules!!



I am thinking it's something like this in a SINGLE formula, but I can't seem to get the validation working...

OR(
    AND(
     checkbox = TRUE,
     ISBLANK(fieldA)),
    AND(
     checkbox = TRUE,
     ISBLANK(fieldB)),
    AND(
     checkbox = TRUE,
     ISBLANK(fieldC))))

But validation doesn't work.... Can anyone help...?
Best Answer chosen by David Ji 6
Danish HodaDanish Hoda
Hi David,

Please try this:
AND(
checkbox = TRUE,
OR(
ISBLANK(fieldA),
ISBLANK(fieldB),
ISBLANK(fieldC)
)
)

All Answers

Danish HodaDanish Hoda
Hi David,

Please try this:
AND(
checkbox = TRUE,
OR(
ISBLANK(fieldA),
ISBLANK(fieldB),
ISBLANK(fieldC)
)
)
This was selected as the best answer
Devi ChandrikaDevi Chandrika (Salesforce Developers) 

Hi David

Try this one

if( (checkbox = true),
OR(
(ISBLANK(field1 )),
(ISBLANK(field2 )),
(ISBLANK(field3 ))
),false)
 

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards

Ajay K DubediAjay K Dubedi
Hi David,

You can do validation Rule like this :

           IF( checkbox = True,
           OR( ISBLANK(field_A),
               ISBLANK(field_B),
               ISBLANK(field _C)), 
           False)


I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
chandravadan kasachandravadan kasa
Hi David,
you can use this 
AND(
Check box=true
OR( 
ISBLANK(field-a) ||
ISBLANK(field-b) ||
ISBLANK(field-c)),false



Thank You,
www.nubeselite.com
Development | Training | Consulting

Please mark this as solution if your problem is solved.
David Ji 6David Ji 6
Hi Guys,

Both method works well. Thanks so much for your help!