Can I invoke from another apex class, lwc or flow, ready-made filter class by salesforce (which described here)?
I tried invoke it through anonymous window in dev console, used next lines of code:
List<Id> oppsId = new List<Id>();
List<Opportunity> opps = [Select Id From Opportunity Where Id = 'XXXXXXX'];
oppsId.add(opps[0].Id);
OppTerrAssignDefaultLogicFilter filter = new OppTerrAssignDefaultLogicFilter();
filter.getOpportunityTerritory2Assignments(oppsId);
But after I run this code, selected opportunity didn't assign to territory. Maybe I invoke it wrong or we can't invoke it like this?
If I click on the "filter" button in the territory setup - everyting works well. So territories set up well