Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Check Calendars to Determine Availability

Learning Objectives

After completing this unit, you’ll be able to:

  • Configure scheduling policy rules to check Salesforce calendars to determine availability.
  • Configure scheduling policy rules to check external calendars to determine availability.

Matt can configure scheduling policy rules to check Salesforce calendar, external calendar, or both to determine service resource availability. Based on the calendar integration, the Salesforce calendar, external calendar, or both can have appointments from both the sources.

Check Salesforce Calendar to Determine Availability

Here’s how Matt configures scheduling policy rules to consider only events on the Salesforce calendar to determine availability.

  1. Click Setup , and then select Setup.
  2. Enter Scheduling Policies in the Quick Find box, and then select Scheduling Policies.
  3. Click Edit next to Default Appointment Scheduling Policy or your custom scheduling policy.
  4. Select Check Salesforce Calendar for Resource Availability.
  5. Click Save.

Default Appointment Scheduling Policy page with Check Salesforce Calendar for Resource Availability selected.

When a user tries to book an appointment, Salesforce Scheduler checks events on the Salesforce calendar to determine resource availability. To learn how event statuses affect availability, see Check Salesforce Calendar to Determine Resource Availability.

Let’s look at an example. Here’s an illustration of how data flows when Matt uses a calendar sync tool with External calendar to Salesforce as the sync direction and enables the Check Salesforce Calendar for Resource Availability policy rule.

The calendar sync tool asynchronously writes external calendar events to Salesforce calendar. When a user is booking an appointment, Salesforce Scheduler reads Salesforce Calendar events—including the ones that have been synced to it—to identify potential conflicts. Salesforce Scheduler then filters all the available time slots and shows only the time slots that don’t have a scheduling conflict with events on the Salesforce calendar.

For example, a service resource blocked their external calendar to attend a training from 1:00 PM to 2:00 PM. The calendar sync tool writes the training event to Salesforce calendar. Salesforce Scheduler reads the appointment from Salesforce calendar and doesn’t show any time slots that conflict with the training when a customer is booking an appointment with that service resource.

Check External Calendar to Determine Availability

Here’s how Matt configures scheduling policy rules to consider only external calendars events to determine availability.

  1. Use the LxScheduler.ServiceResourceScheduleHandler Apex interface to write an Apex class that checks external calendars and returns the time periods that are already booked for the requested service resources. Salesforce Scheduler uses these time periods and removes all the time slots that have a scheduling conflict with these time periods. Matt and the developer work on an Apex class for Outlook.
  2. Associate the Apex class with Salesforce Scheduler flows or API calls through the External Calendar Event Handler scheduling policy rule.
    • Click Setup, and then select Setup.
    • Enter Scheduling Policies in the Quick Find box, and then select Scheduling Policies.
    • Click Edit next to Default Appointment Scheduling Policy or your custom scheduling policy.
    • Select Check External Systems for Resource Availability Lookup next to the Check External Systems for Resource Availability field, and then select your Apex class.
    • Click Save.

The Default Appointment Scheduling Policy page with an Apex class selected in the Check External Systems for Resource Availability scheduling policy rule.

Here’s an illustration of how data flows when Matt enables the Check External Systems for Resource Availability policy rule and calendar integration isn’t set up.

An illustration of data flow from external calendars to Salesforce Scheduler via an Apex class.

When a user tries to book an appointment, Salesforce Scheduler makes synchronous calls to external calendars to identify potential conflicts. Salesforce Scheduler then filters all the available time slots and only shows time slots that don’t have a scheduling conflict with events on the external calendar.

Check Salesforce Calendar and External Calendars to Determine Availability

Matt doesn’t want to sync calendars and wants to make sure that Salesforce Scheduler shows only time slots that don't conflict with events on the Salesforce calendar or external calendar. Here’s how he configures scheduling policy rules.

  • Enable the Check Salesforce Calendar for Resource Availability scheduling policy rule.
  • Use the LxScheduler.ServiceResourceScheduleHandler Apex interface to create an Apex class that checks external calendars and returns the time periods that are already booked for the requested service resources. Then, enable the Check External Systems for Resource Availability scheduling policy rule.

Finalize the Approach

After Matt explores all the options, he enables Event Management to write Salesforce Scheduler appointments to Salesforce Calendar. Then, he uses Einstein Activity Capture to set up a bidirectional sync so that the Salesforce calendar and external calendar have events from both the calendars. Finally, he uses an Apex class and the Check External Systems for Resource Availability scheduling policy rule to synchronously check external calendars to determine availability.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback