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
Jennifer DobosJennifer Dobos 

Need help with creating a rule

User-added image

I'm trying to write a couple of rules for a text field.  As per the screen cap, we would like the "Communication Preference Confirmed" text field to show "Recieved" if the "Communication Opt In Date" has a value OR if the Email Opt Out = True

or

We would also like the "Communication Preference Confirmed" text field to show "Required" if the "Communication Opt in Date"  = NULL and the "Email Opt Out" = False

Thanks!
Best Answer chosen by Jennifer Dobos
Eric-∑Eric-∑
Are you asking for a formula field for "Community Preference Confirmed"? Here is the definition for the formula field, which was tested in my org.

IF((Email_Opt_Out__c || NOT(ISBLANK(Communication_Opt_In_Date__c))), 'Recieved', 'Required')
Please be sure you choose "Treat blank fields as blanks" in the Blank Field Handling section. 

All Answers

Vinit_KumarVinit_Kumar
You should create workflow rule on this object and update the Communication Preference Confirmed field based upon your criteria.
Eric-∑Eric-∑
Are you asking for a formula field for "Community Preference Confirmed"? Here is the definition for the formula field, which was tested in my org.

IF((Email_Opt_Out__c || NOT(ISBLANK(Communication_Opt_In_Date__c))), 'Recieved', 'Required')
Please be sure you choose "Treat blank fields as blanks" in the Blank Field Handling section. 
This was selected as the best answer
Jennifer DobosJennifer Dobos
We are using Salesforce Professional and I don't believe we are able to setup workflow rules.
Vinit_KumarVinit_Kumar
Yes that's right,WF are not allowed in PE org :(
Jennifer DobosJennifer Dobos
Eric, thanks for your help.  Yes, we want to apply the formula to the Communication Preference Confirmeed object.  Essentially if either the Communication Opt in Date has a date in it, OR the Email Opt Out checkox is checked, we want the object to say "Recieved" and if the Communication Opt in Date is blank AND the Email Opt Out checkbox is not checked, we want the object to say "Required".



Eric-∑Eric-∑
Then I think you can use the definition I provided above for the "Community Preference Confirmed" field. 
Jennifer DobosJennifer Dobos
Worked perfect!

Thanks so much for your help!
Eric-∑Eric-∑
Please mark it as a solution if it helps.
Jennifer DobosJennifer Dobos
Is it possible to add an additional formula to the above for if Account billing country equals US, USA, United States the Communication Preference Confirmed object says "Not Required"