I'm trying to assign DML options to an account's update. It's working with the insert, but not wit an update.
Here is the code I'm using:
Database.DMLOptions dmlOpts = new Database.DMLOptions(); dmlOpts.assignmentRuleHeader.useDefaultRule = true; List<Account> accs = [SELECT Id FROM Account LIMIT 10]; Database.update(accs,dmlOpts);
After running that, no territory rules are running. I know how to do it with Visualforce, but no idea using just APEX (as I really need).