Skip to main content

I do have the "re-evaluate Assignment Rules upon save" checkbox defaulted TRUE on page layouts, but is there a way for this to be triggered regardless of where the Account is updated on the Salesforce UI? Most reps are going to be updating the relevant fields inline on the record itself or via reports so it's mind blowing to me if this is not possible.

 

I'm not a developer but I have tried to write an Apex trigger (it might be terrible, i wrote it with the help of ChatGPT LOL. I had it add a "hello world" to validate that I was firing the Trigger).

trigger triggerAccount_Reevaluate_Assignment_Rules on Account (before update) {

// Create a DMLOptions object with the AssignmentRuleHeader enabled

Database.DMLOptions dmlOptions = new Database.DMLOptions();

dmlOptions.assignmentRuleHeader.useDefaultRule = true;

// Update the account records with the DMLOptions object

for(Account acc : Trigger.new) {

acc.setOptions(dmlOptions);

acc.Description = 'Hello World';

}

}

From Google searches / IdeaExchange it seems this has not been solved by Salesforce but I can't see how that's possible. Can someone help or just put me out of my misery?

 @Territory Management

2 个回答
  1. 2023年4月19日 18:53

    hi @Michael Brown thanks! this is actually for ETM for Accounts. i actually am using Flow to do the actual assignment of Account Owner (plus Sales Rep & BDR fields we use), but i need the Territory assignment to re-evaluate for it to work :-/

0/9000