OpportunityTerritory2AssignmentFilter Global Interface
Apex interface that allows an implementing class to assign a single territory to an opportunity.
Method called by Opportunity Territory Assignment job to assign territory to opportunity. Input is a list of (up to 1000) opportunityIds that have IsExcludedFromTerritory2Filter=false. Returns a map of OpportunityId to Territory2Id, which is used to update the Territory2Id field on the Opportunity object.
The following are methods for OpportunityTerritory2AssignmentFilter.
-
getOpportunityTerritory2Assignments(opportunityIds)
Returns the mapping of opportunities to territory IDs. When Salesforce invokes this method, it supplies the list of opportunity IDs, except for opportunities that have been excluded from territory assignment (IsExcludedFromTerritory2Filter=false).
Returns the mapping of opportunities to territory IDs. When Salesforce invokes this method, it supplies the list of opportunity IDs, except for opportunities that have been excluded from territory assignment (IsExcludedFromTerritory2Filter=false).
public Map<Id,Id> getOpportunityTerritory2Assignments(List<Id> opportunityIds)
A key value pair associating each Territory ID to an Opportunity ID.
This is an example implementation of the TerritoryMgmt.OpportunityTerritory2AssignmentFilter interface.