ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Resource Calendar XOG - reset to base for a specific date with exceptions

book

Article ID: 239359

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity PPM On Premise

Issue/Introduction

Resource Calendar exceptions are mentioned in the XOG output of a resource xml and it would look like below

<Calendar baseCalendar="Standard" resetCalendar="false">
        <Days>
          <Day isWorkDay="true" start="2022-04-14">
            <Shifts>
              <Shift finish="12:30:00" start="08:00:00"/>
              <Shift finish="15:00:00" start="13:00:00"/>
            </Shifts>
          </Day>
          <Day isWorkDay="false" start="2022-04-15"/>
          <Day isWorkDay="false" start="2022-04-19"/>
          <Day isWorkDay="true" start="2022-04-20">
            <Shifts>
              <Shift finish="12:00:00" start="09:00:00"/>
              <Shift finish="17:00:00" start="14:00:00"/>
            </Shifts>
          </Day>
        </Days>
      </Calendar>

The requirement is to remove the exception on date 2022-04-14 to match with the Base Calendar using XOG. 
In short, we are trying to perform the same action using XOG what Reset to Base button would do from the Resource - Calendar tab in the application. 

Resolution

The below XML snippet would do a Reset to Base for date 2022-04-14

<Calendar baseCalendar="Standard" resetCalendar="true">
        <Days>
          <Day isWorkDay="true" start="2022-04-14">
          </Day>
          <Day isWorkDay="false" start="2022-04-15"/>
          <Day isWorkDay="false" start="2022-04-19"/>
          <Day isWorkDay="true" start="2022-04-20">
            <Shifts>
              <Shift finish="12:00:00" start="09:00:00"/>
              <Shift finish="17:00:00" start="14:00:00"/>
            </Shifts>
          </Day>
        </Days>
      </Calendar>

The changes made are, 

resetCalendar="true" -- This was false in the first snippet

<Shifts>
<Shift finish="12:30:00" start="08:00:00"/>
<Shift finish="15:00:00" start="13:00:00"/>
</Shifts> -- These 4 shift lines are removed