FSL: ServiceTerritoryID becomes null for a single SA resulting in "Too many rows" or "Apex CPU Time Limit" error. All other SA works fine.
Apex , API , VisualForce , Field Service
Last updated 9 days ago ·Reference W-9817896 ·Reported By 1 users
In Review
Summary
ServiceTerritoryID becomes null for a single SA.
Calling FSL.getCandidates clears the “Service Territory” from SA, which in turn causes "Too many query rows" or "Apex CPU Time Limit" exception.
The issue will occur when all the mentioned above occurs Altogether:
* A customer has more than 2000 service territories in the org.
* A customer has a WO with multiple children SAs that have different territories
* When we get all territories that are assigned to all the invoked service appointments' "brothers" (same parent WO), the first territory in the list isn't the territory of the invoked SA.
Repro
>Ensure the org has more than 2000 Territories
>Edit the "Max territories to display on UI" custom setting to be lower than the total number of territories in the org.
>Create a WO
>Create 5 SAs, 3 of them with ST = "Ter A" and 2 of them with ST = "Ter B"
>Run Get Candidates from the global action, on one of the SAs on "Ter B".
>Notice that the invoked SA's service territory gets nullified.
>The issue is happening due to the "Search Territories on more than 2k service territories" feature.
Workaround
>The only workaround is creating WOs that their children's SAs have the same territories.
> If above workaround is not feasible , please manually schedule the appointment via drag drop
Reported By (1)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.
