---
schema_version: "1"
id: 6b575ab06e67a09d7c4a7b33173b9db93fe3c292c131ee5a516a880a0f527cfd
title: "Work Rule Type: Service Appointment Visiting Hours"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/pfs_optimization_theory_work_rules_visiting_hours.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.pfs_optimization_theory_work_rules_visiting_hours.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 338b13360cbe948c4b3919494f78160566b64ab886e1019f8c53cd5998276f4a
description: Service Appointment Visiting Hours is an Apex work rule type that enforces your customers’ operating hours. For example, if an account’s operating hours are weekdays between 8:00 AM and noon, appointments for that customer are scheduled only within those hours.
products:
  - Field Service
release: "264"
---
# Work Rule Type: Service Appointment Visiting Hours

Service Appointment Visiting Hours is an Apex work rule type that enforces your customers’ operating hours. For example, if an account’s operating hours are weekdays between 8:00 AM and noon, appointments for that customer are scheduled only within those hours.

### 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 Agentforce Field Service and Operations 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>

![Package icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_field_service-264-0-0-production-enus/3f7dceb9-dd70-454a-b49e-bbb4526a158d/support_field_service/images/fs_package.png) _This is a Field Service managed package feature._

To define a customer’s preferred hours of service, create operating hours for them from the Operating Hours tab. Select the operating hours in the Operating Hours ID field on the account. Work orders created for the account always inherit the account's operating hours in the Visiting Hours field, and service appointments use their work order’s visiting 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 Defining designated work on operating hours that represent your customer’s visiting hours isn’t supported. See [Work Rule Type: TimeSlot Designated Work](https://help.salesforce.com/s/articleView?id=service.pfs_optimization_theory_work_rules_designated_work.htm&language=en_US).

When you’re not using Enhanced Scheduling and Optimization:

- Visiting hours use the time zone of the service territory.
- If the location has no time zone specified, GMT is used.

When you’re using Enhanced Scheduling and Optimization:

- Visiting hours use the time zone of the operating hours record or the time zone of the service appointment’s service territory, depending on your defined setting. When you work across multiple time zones, we recommend that you deselect the **Use the Visiting Hours object’s time zone when an appointment has visiting hours** setting, so that you use the time zone of the appointment’s service territory. To access the setting, in the Field Service Settings tab, click **Scheduling** | **General Logic**.
- You can [add holidays to visiting Operating Hours](https://help.salesforce.com/s/articleView?id=service.fs_oh_holidays.htm&type=5&language=en_US) that represent the time when customers aren’t available to receive services. These holidays take precedence over the customers’ preferences for visiting operating hours.
- Multiday work doesn’t support visiting 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 Dispatchers can still manually schedule appointments outside a customer’s operating hours, but a rule violation is shown.

Create work rules from the Work Rules tab. To view or add work rule fields open the **Object Manager** in Setup and select the **Work Rule** custom object. Add work rules to a scheduling policy from the **Customize Scheduling Policies** page in Guided Setup or from the Scheduling Policy Work Rules related list on a scheduling policy.

#### See Also

- [Guidelines for Creating Operating Hours for Field Service](https://help.salesforce.com/s/articleView?id=service.fs_oh_considerations.htm&release=264.0.0&type=5 "Operating hours in Field Service can represent the availability of a mobile worker for scheduled work (defined on the Service Territory or Service Territory Member record), appointment booking arrival windows (defined as a default in Field Service Settings, or per Work Order, via Entitlements), and customer availability requirements (Visiting Hours on the Work Order). Learn how to set operating hours for each scenario.")
- [Create and Manage Field Service Work Rules](https://help.salesforce.com/s/articleView?id=service.pfs_optimization_theory_work_rules.htm&release=264.0.0&type=5 "Work rules refine the list of candidates for a service appointment by rejecting service resources that violate any rule. Add work rules to any Field Service scheduling policy to guide schedule optimization.")