You need to sign in to do that
Don't have an account?
Jamuna Mani 6
Enterprise Territory Management - Issue with the Apex class "OppTerrAssignDefaultLogicFilter"
We recently implemented Enterprise Territory Management in our organization. I have used the "OppTerrAssignDefaultLogicFilter" apex class to display the territory name in the opportunities. When the button "Run Opportunity Filter" is clicked, the apex class populates the territory name on the opportunities . I am observing the following issues with the Apex class:
- Even though the account has only single territory with the maximum priority, the associated opportunity doesn't get the territory assigned
-Under the same account one opportunity gets territory assigned whereas the other opportunity doesn't get territory assigned
- I have even tried to run this class for small group of records. Still not all the records get the territory assigned.
Note: We have only one Territory model active
- Even though the account has only single territory with the maximum priority, the associated opportunity doesn't get the territory assigned
-Under the same account one opportunity gets territory assigned whereas the other opportunity doesn't get territory assigned
- I have even tried to run this class for small group of records. Still not all the records get the territory assigned.
Note: We have only one Territory model active
All Answers
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000MJ7YIAW
Basically, I commented out these 2 lines in the code:
//&& (tp.territory2Id != opp.Territory2Id))
//&& (tp.moreTerritoriesAtPriority == false)
If you have more than one territory per account, you may not want to do that.
Thanks for the help Becky. I look forward to an update to the code.
Agree with EJ and I've had the runaround on this too, sometimes the job just fails (albeit only partially) but there's no further information provided as to why some Opps just don't get updated even though they are included in the filter.
For this, check out blog Territory Management In Salesforce Can Increase Your Profit (http://howtodoitinsalesforce.blogspot.in/2017/01/territory-management-in-salesforce-can.html) !
Thanks,