CalendarExceptions out of sync? RRS feed

  • Question

  • It seems that my calendar exceptions have gone out of sync - or I've completely misunderstood calendar exceptions (which would not be the first time: why use the "reserved" term exception for something that is not a derivative of the Exception class but instead a deviation description?).

    I have a C# application that transfers resource and project data from another ERP system to MSP. It only transfers resources that have changed, and lately I have experienced a problem with this. Calling UpdateResources now returns error code 13039 - CalendarUnusedCalendarException for two resources. After some exploration, I have learned that both resources have a BaseCalendarUniqueId (which is required according to the description of the error), and the references from the calendar exceptions to the resources match. Still, an error is reported for each calendar exception, all with ErrName "My Timesheet" and with no attributes.

    As the transfer application only works with altered resources, I cannot see if calendar exceptions exist for other resources, and I don't want to spread the problem by changing a third resource in my ERP system. So I've also tried to find the calendar exceptions in the DB, but learned here that that is not possible, so I cannot see if there is a discrepancy in the stored data. And now I've run out of ideas...

    I hope someone here can help, mainly to circumvent the 13039 error, but also to correct the problem at the root cause.

    Kaspar Lundsby.

    Tuesday, April 12, 2011 1:07 PM

All replies

  • Hello Kaspar,

    after upgrading from 2007 to 2010 we´re getting this error too.

    We update up to 4 resource customfields, availability and calendar exceptions. If we try to update the availability and the resource has calendar exceptions the CalendarUnusedCalendarException is thrown. On a customer site, we´ve the additional problem that resources can´t logon PWA anymore after the exception is fired, to fix this we´ve to go to  "Manage User" in Serser Settings , open the resource and click "Save" without changing anything.

    But everything works fine if the resource doesn´t have any calendar exceptions.

    So at the moment we use the following workaround to set availability:

     - Read resource
     - Copy the calendar exceptions to a new "Backup" DataTable
     - Delete all rows from the source DataTable
     - Call UpdateResources method
     - Read the resource
     - Delete availability rows (in the specified date range, so we can add the new availbility)
     - Add new availability rows
     - Call UpdateResources method
     - Read resource
     - Adding new calendar exception rows using the "Backup" DataTable as template
     - Call UpdateResources method

    Any hints/comments appreciated :-)




    Monday, May 30, 2011 9:39 AM
  • After the "workaround" mentioned above, i recognized that the resource i update cannot login PWA anymore or get the "An unknown error has occured" message mentioned on , if i try to open Project/Resource Center or MyTasks page. But the solution provided in the article doesn´t fit, the IIS settings are fine.

    I my case it is the same resource account the update code is running with. After the last call of the UpdateResources method, i try to read
    to read the resource again to update calendar exceptions. The call to ReadResource fails with "The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'", Message=The remote server returned an error: (401) Unauthorized"

    SharePoint/ProjectServer permissions for this account are still there and the resource is still active. I can solve this if i edit (open) the resource in PWA ('Manager Users') and click "Save".

    This only happens if i update the ResourceAvailabilities table, updating the CalendarExceptions or CustomFields table works fine.

    Any hints/comments appreciated :-)


    Friday, June 3, 2011 11:35 AM
  • Hello magran and Kaspar,

    We are stucked in a applicattion migration (PWA 2007 to PWA 2010) that makes the users and calendars importation from a third-party ERP. We know that there are two types of CalendarException, from Resources and from Base Calendars.

    The message that it´s recevied when it´s used the method UpdateResources, as you, the CalendarUnusedCalendarException.

    Did you finally solved this issue??

    Any helps would be appreciated!!



    Miguel Soler
    Monday, September 26, 2011 3:19 PM
  • Hello Miguel,


    i didn´t resolve the "CalendarUnusedCalendarException" issue, i´m still using my "workaround" mentioned above.

    I only get rid of the login issue, after updating the ResourceAvailability table, call the SetModified() method on the Resource table for the specified resource.  If i don´t call this method, the WRES_CLAIMS_ACCOUNT will be deleted on the UpdateResources method.




    Monday, October 10, 2011 5:33 AM