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
BhavanaSinghBhavanaSingh 

Trailhead Using Basic Logic in Checkbox Formulas NOT() example

This example says that if any fields are not filled in, the contact complete checkbox should remain unchecked
 
!(ISBLANK(FirstName) && 
ISBLANK(LastName) &&
ISBLANK(Phone) &&
ISBLANK(Email) &&
ISBLANK(MailingAddress))
However, the way it is coded, the expression inside the () will return No if any fields are not filled in and then and a NOT of that will return a yes
James LoghryJames Loghry
In my engineering classes, we were taught to map out boolean conditions like this using what are known as truth tables.  https://en.wikipedia.org/wiki/Truth_table.

The idea is you would map out  table with Firstname, Lastname, Phone, MailingAddress, etc across the top, and then fill out all the combinations of 0 (or false conditions) and 1 (or true conditions), and then come to a conclusing how your logical statement should look like.

If you wrote out a truth table for this condition, you would notice that the term "ANY" really refers to an OR condition, instead of an AND condition which relates to "ALL" criteria.

In other words, if you used || instead of &&, you would likely get the desired effect.

Also, I prefer to write it out as OR(ISBLANK(Firstname),ISBLANK(Lastname),ISBLANK(Phone)...... instead of using the || operator, as it takes fewer characters to implement.
James LoghryJames Loghry
My typing there is atrocious, but hopefully that gets you on the right track. :)
Amit Sinha 39Amit Sinha 39
Replace all the && with || and it should work as desired.
Let me know if that helped you out.
BhavanaSinghBhavanaSingh
yes, I agree with you - I was just pointing out the error in the trailhead :)