---
schema_version: "1"
id: eaeca5c7a17679875900f96c0e6923c113b8bb7ab6cf8464ed46e3e85723ae29
title: Optimization Horizon
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/pfs_optimization_horizon.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.pfs_optimization_horizon.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 782e66efe8fe1b36cf526e713f5512cca0973dd3c90269c52ffec044e4e99af3
description: Specify a time period for your Field Service optimization requests to focus optimization processing on the required dataset.
products:
  - Field Service
release: "264"
---
# Optimization Horizon

Specify a time period for your Field Service optimization requests to focus optimization processing on the required dataset.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">The Field Service core features, managed package, and mobile app are available in <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions.</td></tr></tbody></table>

The optimization horizon defines the time period of data sent to the engine to be optimized as well as the time period in which appointments can be scheduled. The data consists of the service resources active during that time, operating hours, shifts, service appointments, and any other data that must be considered when building a schedule. An optimization horizon is specified in any of these scheduling services.

- Global or In-day optimization from the Classic Dispatch Console
- Resource Schedule Optimization
- Optimization of scheduled jobs
- Optimization methods in the OAAS class

Consider these two aspects when understanding which service appointments are sent to optimization within the optimization horizon:

**Total Set of Service Appointments Sent to Optimizer**

The optimizer needs information on the service appointments that can affect scheduling decisions, including appointments that can’t be optimized, such as pinned service appointments and service appointments not meeting filter criteria. For example, service appointments in a Completed status are sent to optimization, even though the optimization engine can’t move these appointments. The engine still needs information about the Completed service appointment to create a schedule around it.

Knowing the total number of service appointments sent to optimization in an optimization request is important to estimate any impact on optimization limits. See [Field Service Limits and Limitations](https://help.salesforce.com/s/articleView?id=service.fs_limits.htm&type=5&language=en_US). The criteria of service appointments sent to optimization can be defined as:

- Service Appointments that aren’t assigned to a service resource:
    - Earliest Start Permitted < Optimization Horizon End + 24 hours AND
    - Due Date > Optimization Horizon Start - 24 hours
- Service Appointments that are assigned to a service resource:
    - Scheduled Start < Optimization Horizon End + 24 hours AND
    - Scheduled End > Optimization Horizon Start - 24 hours

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_field_service-264-0-0-production-enus/3f7dceb9-dd70-454a-b49e-bbb4526a158d/images/icon_note.png)

Note To enhance scheduling efficiency, the optimization engine includes service appointments up to 24 hours before or after the specified optimization horizon. This ensures that the engine considers nearby appointments that can influence the schedule, for example, service appointments with complex work dependencies. The optimization request doesn’t modify service appointments outside the horizon.

**Service Appointments That Can Be Optimized**

The criteria for service appointments eligible to be optimized are defined as:

Service appointments that aren’t assigned to a service resource:

- Without an arrival window:
    - Earliest Start Permitted < Optimization Horizon End AND
    - Due Date > Optimization Horizon Start
- With an arrival window:
    - Earliest Start Permitted < Optimization Horizon End AND
    - Due Date > Optimization Horizon Start AND
    - Arrival Window Start < Optimization Horizon End AND
    - Arrival Window Start > Optimization Horizon Start

Service appointments that are assigned to a service resource:

- Scheduled Start < Optimization Horizon End AND
- Scheduled End > Optimization Horizon Start

Some considerations for service appointments that can be optimized.

- Service appointments classified as pinned and service appointments that don’t meet filter criteria aren’t optimizable.
- Service appointments included in the dataset but not in the list of service territories to be optimized can’t be optimized.
- When you’re not using Enhanced Scheduling and Optimization, rule-violating service appointments can’t be optimized. When you’re using Enhanced Scheduling and Optimization, the engine can find an acceptable schedule for rule-violating service appointments or drop these appointments from the schedule.
- Service appointments defined with Keep Scheduled Criteria can be optimized, but the optimization request can’t unschedule these appointments.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_field_service-264-0-0-production-enus/3f7dceb9-dd70-454a-b49e-bbb4526a158d/images/icon_note.png)

Note Administrators can decide to allow or abort overlapping optimization horizons through configuration. See [Manage Optimization Conflicts](https://help.salesforce.com/s/articleView?id=service.pfs_manage_opt_conflicts.htm&type=5&language=en_US).

#### See Also

- [Field Service Limits and Limitations](https://help.salesforce.com/s/articleView?id=service.fs_limits.htm&type=5&language=en_US)
- [Manage Scheduled Jobs in Field Service](https://help.salesforce.com/s/articleView?id=service.pfs_set_up_jobs_enhanced.htm&type=5&language=en_US)
- [Optimize Today’s Field Service Schedule](https://help.salesforce.com/s/articleView?id=service.pfs_in_day_optimization.htm&type=5&language=en_US)
- [Optimize a Single Field Service Resource’s Schedule](https://help.salesforce.com/s/articleView?id=service.pfs_resource_optimization_user.htm&type=5&language=en_US)
- [Keep Important Appointments Scheduled During Optimization (Beta)](https://help.salesforce.com/s/articleView?id=release-notes.rn_fieldservice_250_keep_scheduled.htm&language=en_US)
- [OAAS Class](https://developer.salesforce.com/docs/atlas.en-us.250.0.field_service_dev.meta/field_service_dev/apex_class_FSL_OAAS.htm)