web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Using LoadCalendar/DeleteCalendar, safe way to clear the Bookable Resource calendar day?

(1) ShareShare
ReportReport
Posted on by 33

Hi all,

 

I’m working with the LoadCalendar / DeleteCalendar / SaveCalendar actions and I’m trying to clear a Bookable Resource calendar for a specific day only (without affecting other days or existing future bookings) with PowerAutomate flow.

 

My goal:

  • Load the resource calendar

  • Remove all slots for a given date

  • Save the calendar back

Currently I use LoadCalendar action to load all calendar events for one Bookable Resource on specific day, and I loop over it and call DeleteCalendar which I provide with 

{
  "CalendarId": "@{items('Apply_to_each_RulesForDay')?['OuterCalendarId']}",
  "EntityLogicalName": "bookableresource",
  "InnerCalendarId": "@{items('Apply_to_each_RulesForDay')?['InnerCalendarId']}",
  "UseV2": true
}

The issue is that it not necessarily deletes all the calendar events. Could this be when they're added on top of each other? I'm not sure how this works.

 

Before I go further, I wanted to ask:

  • Is there a supported / safe approach to clear availability for just one day?

  • Are there any known best practices or patterns for this scenario?

Any guidance or examples would be greatly appreciated.

Thanks in advance!

I have the same question (0)
  • Suggested answer
    Assisted by AI
    Suriyanarayanan V Profile Picture
    132 on at

    You’re running into a very common Field Service calendar issue. LoadCalendar + DeleteCalendar does not guarantee that all availability for a single day will be removed, because a Bookable Resource’s calendar is made up of multiple layered calendar rules, not a single entry.

    That’s why you’re seeing inconsistent results.

    Why DeleteCalendar doesn’t remove everything

    A Bookable Resource calendar is composed of:

    1. Outer Calendar (resource-level calendar)

    Contains:

    • Working hours

    • Time-off

    • Recurring rules

    • Overrides

    2. Inner Calendars (inherited calendars)

    From:

    • Organizational units

    • Resource categories

    • Work hours templates

    • Time-off requests

    • Business closures

    When you call LoadCalendar, you get a flattened view of all rules for that day.
    But when you call DeleteCalendar, you are only deleting one specific rule, not the entire availability for that date.

    If multiple rules overlap (which is very common), you must delete each rule individually.

    This is why some slots remain.

    Why overlapping rules cause problems

    Example:

    • A recurring weekly working-hours rule

    • A one-off override

    • A time-off rule

    • A template-based inherited rule

    Even if you delete one, the others still produce availability.

    This is expected behaviour.

    Supported / safe approach to clear availability for one day

    ✔️ Option 1 — Create a “Time Off” rule for that day (recommended)

    Instead of deleting rules, you add a time-off entry for the entire day.

    This is the officially supported way to block availability.

    Create a Calendar Rule:

    • CalendarId = resource’s calendar

    • StartTime = date 00:00

    • EndTime = date 23:59

    • ExtentCode = 2 (Time Off)

    • IsAllDayEvent = true

    This overrides all working hours for that day without touching existing rules.

    This is the safest and most predictable method.

    ✔️ Option 2 — Delete only the rules you created (not inherited ones)

    If you must delete rules:

    1. Use LoadCalendar

    2. Filter only rules where:

      • InnerCalendarId = resource’s own calendar

      • ExtentCode = working hours (1)

    3. Delete only those

    Do not delete inherited rules — they will regenerate or cause unexpected behaviour.

    ✔️ Option 3 — Use the Work Hours API (newer approach)

    If you’re using the newer Field Service v2 APIs, Microsoft recommends using:

    • msdyn_GetWorkHours

    • msdyn_SetWorkHours

    These APIs handle the calendar layering for you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
11manish Profile Picture

11manish 36

#2
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 32

#3
ManoVerse Profile Picture

ManoVerse 30 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans