Scenario Overview
In a Salesforce Field Service optimization job configured to run with 'Optimize in Stages', each service territory is processed in a separate stage — meaning one optimization request is created per service territory. When such a job contains 30 service territories, the sixth service territory in the job's service territory list may receive a failed optimization request with a status of 'Open'. This failure occurs because an Apex job encounters the following error:
Salesforce Field Service: Too many query rows: 50001
After this failure, optimization requests for the remaining service territories are not created.
Understanding Engine Behavior
This article explains why optimization jobs skip service territories after a failure, and how behavior differs between the Logic Separation (LS) engine and the Enhanced Scheduling and Optimization engine.
In the Logic Separation (LS) optimization engine, this behavior has existed since the beginning — when one optimization request fails, subsequent service territory optimization requests are not created.
However, in the current Enhanced Scheduling and Optimization engine, this behavior is different: the system does not skip the creation of optimization requests for service territories that follow the failed one. Subsequent service territories continue to be processed.
000396116

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.