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
Scott Chambers 2Scott Chambers 2 

If Then Rules

I would like to create an If-Then rule where if the account owner = x then the account representative(custom field) equals x. If account representative equals x, then account manager equals a, b, or c
KodsiKodsi
which rule you want tu use, validation rule or workflow rule, you can also use apex trigger?
Abdul KhatriAbdul Khatri
What are your assignment rules? I mean the owner are known or dynamic, so in case of dynamic what are the rules?
Scott Chambers 2Scott Chambers 2
The owners are known and the account managers/reps are known as well. I’m relatively new at this.
Scott Chambers 2Scott Chambers 2
I believe I'd want to use an apex trigger, because I also want it to apply to accounts already created. The Salesforce that I inherited is filled with old accounts that do not have the proper ownership and account managers/representatives.
Abdul KhatriAbdul Khatri
You know the account managers / reps now but they may change in future which mean whatever route you take, maintaining them should be easy. What I mean by that if they change, make sure you don't need to go into the code again. So my suggestion create a assignment matrix between account Managers and reps. Here are few suggestion you can take
  1. Assign Manager for each User in the User Setup
  2. Create a custom metadata settings 
  3. Create Custom Object
These are right now coming off the cuf but you can think more, just objective not to hard code them in the code.

Another thing since you mentioned that you also need to work on the historical accounts, make sure the code works in both the cases old and moving forward.

Let me know if you need further help from the design perspective.