You need to sign in to do that
Don't have an account?
Nerv123
"Change Owner" in Opportunity to include "Change Territory"
I need to have Territories assigned to the Opportunity based on the owner of the opportunity.
If the Opportunity Owner is changed using the "Change" option beside the field Owner in Opportunity, then the logic must include automatically changing the territory too, based on the territory assignment of the owner.
Where can I find the standard salesforce logic for "Change"?
If I cannot find it, any ideas on how I can achieve this complete logic with a single click?
Thanks So Much!
Werewolf,
I'm a newbie to Apex and I tried to create a trigger (below) to do exactly that, but can't seem to get it to work properly. Any suggestions would be greatly appreciated. Thanks!
Rich
trigger setOppTerritory on Opportunity ( before insert, before update ) { for (Opportunity o : [ SELECT Id, TerritoryId from Opportunity where Id in : Trigger.new ] ) { List <Opportunity> opp = new List<Opportunity>(); opp.TerritoryId = opp.owner.TerritoryId; update opp; } }