You need to sign in to do that
Don't have an account?
Matt O'Hara
Account Territory update after custom field update - How To
I'm new to development but have been watching Intro to Apex webinars and I think I have a good foundation to write my first Trigger. Before I get started I'd like to make sure that I'm heading in the right direction.
I have a number of fields on Accounts that are updated via a Process when the Billing Address Postal/Zipcode field changes. Rep1, Rep2, Rep3, etc. This works fine. I need a Trigger that updates the Territories. The Territory rules just look at the field values for Rep1, Rep2, Rep3, etc.
I think that I'm tring to do an "after update, after insert" Trigger, but I don't know what I'm trying to update. Is it AccountShare?
Thanks in advance!
I have a number of fields on Accounts that are updated via a Process when the Billing Address Postal/Zipcode field changes. Rep1, Rep2, Rep3, etc. This works fine. I need a Trigger that updates the Territories. The Territory rules just look at the field values for Rep1, Rep2, Rep3, etc.
I think that I'm tring to do an "after update, after insert" Trigger, but I don't know what I'm trying to update. Is it AccountShare?
Thanks in advance!
AccountShare handles record visibility (basically the "Sharing" button) - but if you're talking actual Salesforce Territory Management, are you looking for a way to force the Territory rules to recalculate?
Well, that's a bit tricky. =) There isn't a way in straight APEX to force those to recalculate. You'll need to invoke the SOAP API to make this happen - check out this post: https://developer.salesforce.com/forums/ForumsMain?id=906F00000008vLTIAY
https://help.salesforce.com/apex/HTViewSolution?id=000006792&language=en_US
Does that change things at all?