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
ShayKhanShayKhan 

Updating a field value to blank depending the account type and open opportunities.

Hello All,
This is sort of an open discussion question but a solution is definitely apprecaited, i want to know whats the best solution to this ask. (Workflow or a Trigger)

The ask is;

-We have a field on contact level called "First SDR Owner" that gets updated when a new Lead comes in. 
-IF this new contact is associated with an Existing Account, and that account type = Customer OR if that account has any Open opportunity. Than make the field "First SDR Owner" Blank. 

As always, all help is greatly appreciated! 

Thanks!
Maharajan CMaharajan C
Hi ShayKhan,

Yes you can do this by Workflow.

1. Create one Rollup field in Account --> Opportunity (Name the Field as Open Opportunity Count ) --> Count --> Only records meeting certain criteria should be included in the calculation

set the Filter Criteria as Closed NOT EQUAL TOTrue .

2. Create the Workflow in Contact Object

Criteria : 
(Account: Open Opportunity Count   GREATER THAN   0) AND (Account: Type    EQUALS     Customer)

Field to UpdateContact: First SDR Owner
Specify New Field Value : A blank value (null)


If you don't want to create the new field in Account then we have to go to the Trigger but try to use the Out of Functionalities:

Can you please Let me know if it helps or not!!!

If it helps don't forget to mark this as a best answer!!!

Thanks,
Raj