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
Mckay DunnMckay Dunn 

Automatically select emailoptout if contact marked as inactive

I've built a custom contac checkboxt field which just reads "inactive" which users select if the contact leaves the account. What I'd like to do is whenever that box is selected the "emailoptout" checkbox is also automatically selected.

I'm sure this can be done in validation or trigger, but I don't have much experience using those tools. Can someone help me get started on that?
Best Answer chosen by Mckay Dunn
kaustav goswamikaustav goswami
You can try this out.

Go to Setup - Create - Workflow and Approvals

The click on New and select Contact.

Set the evaluation criteria to - Every time a record is created or edited

Then select the rule criteria option as Formula Evaluates to True.

The set a formula that suits your need:

Something like

AND(
ISCHANGED( inactive__c ) ,
inactive__c = true
)

Then add an immediate action to this workflow. The immediate action will be set on the contact object and choose the EmailOptOut field.

Then select the False value.

Save it and then activate the workflow rule. Please let me know if this works.

Thanks,
Kaustav

All Answers

AshlekhAshlekh
Hi,

If you want to update a field based on other field than we mostly go with workflow.

By workflow you can set creteria when workflow need to execute and which field you need to update.

We can write trigger but salesforce provide a automation then we use every thing of salesforce in good way. It's depend on you which approch you would like to go with
kaustav goswamikaustav goswami
You can try this out.

Go to Setup - Create - Workflow and Approvals

The click on New and select Contact.

Set the evaluation criteria to - Every time a record is created or edited

Then select the rule criteria option as Formula Evaluates to True.

The set a formula that suits your need:

Something like

AND(
ISCHANGED( inactive__c ) ,
inactive__c = true
)

Then add an immediate action to this workflow. The immediate action will be set on the contact object and choose the EmailOptOut field.

Then select the False value.

Save it and then activate the workflow rule. Please let me know if this works.

Thanks,
Kaustav
This was selected as the best answer
Mckay DunnMckay Dunn
That did it, thank you Kaustav!