You need to sign in to do that
Don't have an account?
Tyler Harris
Struggling With AND OR Formula logic with Boolean fields
Basically what I want to accomplish is
1) If the field is missing country prevent the record from saving OR
2) If the field is marked "email opt out" equals true, ignore the missing country and save.
Is this possible with formula validation?
1) If the field is missing country prevent the record from saving OR
2) If the field is marked "email opt out" equals true, ignore the missing country and save.
Is this possible with formula validation?
IF( OR( AND( AND(Country == "", $Profile.Name <> 'System Administrator', $User.Id <> "005Q000000O5P3v"),ISNEW(),HasOptedOutOfEmail)), true, false )
step by step:
Country is blank
User id is not 005Q000000O5P3v
It's not a NEW record
The email opt out box is not checked
The user is not an administrator
- Make sure the "Active" checkbox is checked on the validation rule.
- Ensure the user you are testing as is not System Admin profile (line 6) or User.ID 005Q000000O5P3v (line 3)
- Line 4 prevents a validation check if it is a new record. It won't matter what the other criteria is if it is new.
More simplistic version below: Try this first, then add additional criteria as neededISBLANK(country) is only applicable if the other conditions within the AND( ) are true as well, so I believe the above code would be correct. Did you try using the most basic version and testing, then adding one condition at a time?