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.
- Click , 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 Salesforce Calendar for Resource Availability.
- Click Save.
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.
- 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. - Associate the Apex class with Salesforce Scheduler flows or API calls through the External Calendar Event Handler scheduling policy rule.
- Click , 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 next to the Check External Systems for Resource Availability field, and then select your Apex class.
- Click Save.
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.
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.