none
error "CalendarUnusedCalendarException" RRS feed

  • Question

  • Hello! I do update resources via PSI in MS Project 2010. And I get error "CalendarUnusedCalendarException" but I do nothing with calendars. Do you know what does it mean?
    Thursday, January 27, 2011 3:26 PM

All replies

  • It means that your program has created a calendar exception that does not have a corresponding calendar. Set a breakpoint before using the UpdateResources method, and examine the ResourceDataSet.CalendarExceptions table. Also see if there is a BaseCalendarUniqueId for that resource in the Resources table.
    Jim Corbin [MSFT]
    Thursday, January 27, 2011 4:12 PM
  • Hi Jim,

     

    Ok, I undertand what you mean but, does it exist a way to determine which calendar exception is causing that? or Does it exist a workaround to solve that??

    We´re facing this issue for weeks and we haven´t solved yet!!

     

    Thanks in advance!


    Miguel Soler
    Wednesday, November 16, 2011 2:17 PM
  • Are you are using UpdateResources to make a change, or to create a resource? Use ReadResources to get the ResourceDataSet for all resources, and check the BaseCalendarUniqueId for the resource that you are changing. Also check the Reporting db to verify that the MSP_EpmResource_UserView.ResourceBaseCalendar matches. To get a list of all base calendar names and IDs, use the ListCalendars method. Somewhere in the ResourceDataSet, there is an invalid or missing calendar GUID.


    Jim Corbin [MSFT]
    Wednesday, November 16, 2011 5:28 PM
  • Hi Jim,

     

    Thanks for your reply. Yes I use UpdateResource, and of course I use ReadResources and I´ve already checked the BaseCalendarUniqueId. As you say "somewhere in the ResourceDataSet", sure, there is an invalid or missing calendar GUID.

    This problem is coming with every resource I have, so I´m not able to identify what is wrong in that dataset...

    I need a code to find which Calendar is the wrong and delete it.

     

    Any helps would be appreciated.

    Kind Regards!


    Miguel Soler
    Wednesday, November 16, 2011 5:37 PM
  • Project support indicated that there may be an issue with resources that have calendar exceptions due to a non-working entry in their timesheet. If you have that situation, try a workaround of exporting the exceptions, deleting them, updating the resource, and then restoring the exceptions.
    Jim Corbin [MSFT]
    Friday, November 18, 2011 9:48 PM
  • Hi Jim,

    Thanks for your interest in that issue. As I understand in your reply, you are telling me that we have to make a PSI development to first keep all the exceptions, delete them from Project Server, and after the update the resource, restore the calendar exceptions for that resource?

    I guess I will have to do the same for all the resources in that development, no?

    Many thanks Jim!


    Miguel Soler
    Friday, November 18, 2011 10:32 PM
  • That is a suggestion I heard from the support folks; it has not been thoroughly tested yet, so it is up to you whether you want to go to all that work. It also would make sense only if your resources have non-working entries in their timesheets.

    --Jim


    Jim Corbin [MSFT]
    Friday, November 18, 2011 10:39 PM
  • Yeah Jim, I understood. Indeed I´m not pretty sure if our resources have non-working entries in their timesheets. I have to check it yet. Do you know how?

     

    Thanks!


    Miguel Soler
    Friday, November 18, 2011 10:43 PM
  • Check the MSP_TimesheetLine_UserView.TimesheetLineClassType in the Reporting DB, for value=1 (see TimesheetEnum.LineClassType Enumeration for other values).
    Jim Corbin [MSFT]
    Friday, November 18, 2011 11:02 PM
  • I am experiencing this same issue and just verified that my resource has a VALID BaseCalendarUniqueId.  I looked at the ResourceDataSet.CalendarExceptions table, but don't see anything popping out to me that would be causing the problem.  We are getting this issue for a handful of users, but I have only reviewed one specific resource.  I also tried to open the particular resource within PWA > Server Settings > Manage Users and just saved the resource.  He had a Standard Base Calendar, and everything saved as expected.

     

    Any more guidance on how to resolve this issue?

     

    I also ran the TimesheetLineClassType Query that you provided and we have none with a value of 1.

    Wednesday, December 7, 2011 6:28 PM
  • Hi Sara, I'm working on a blog posting about this - but the easiest work around is to just pass a dataset that contains the changes you wish to make back to the resources web service.  This will then not contain any CalendarException records (assuming that is not what you are changing) and will not trigger that error.  It appears to be a bug but no fix planned yet.

    If you need pointers on how to trim down the dataset let me know - but easiest is to merge from the updated dataset to an empty one then pass that the the PSI.

    Best regards,

    Brian.


    Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page
    Wednesday, December 7, 2011 10:06 PM
    Owner
  • Hi Brian - thank you very much for your response.  It's nice to know that there's at least a workaround.  Do you know if this issue existed (or still exists) in PS2007?  I could still use some guidance if you have the time.  I'm troubleshooting someone else's code and still trying to get a hand of what is happening.  I know that we are updating the Available From and Available To fields.  But other than that I don't know that we're doing anything specific with Calendar Exceptions.  I am struggling because I don't actually see any calendar exceptions for this one user that I'm testing with.  Can you offer some information on how to actually see the problem?
    Thursday, December 8, 2011 1:16 PM
  • Hi Sara,

    A good way to see the dataset and the CalendarExceptions is to use the data visualizer in Visual Studio.  Once the dataset has been populated then you can hover over the variable representing the dataset and then click on the magnifying glass icon.  It will show the resources table by default but you should be able to select the other data tables too.  I have seen VS freeze up doing this - but works most times.

    I'm not sure if this same bug was present in 2007.

    In terms of code work around this then the following snippet assumes that you have a dataset already and have made your changes and it is called updateDs.  You then create a new dataset called changeDs, and you merge the changes from updateDs into this clean dataset.  Then you use changeds as the dataset to pass back to the Update PSI method.

    SvcResource.ResourceDataSet changeDs = new SvcResource.ResourceDataSet();

    changeDs.Resources.Merge(updateDs.Tables[updateDs.Resources.TableName], true);

    resourceClient.UpdateResources(changeDs, false, false);

    Hope this helps Sara.  Best regards,  Brian.


    Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page
    • Proposed as answer by Miguelet_ Wednesday, December 14, 2011 8:09 AM
    Thursday, December 8, 2011 4:05 PM
    Owner
  • Hi Brian-

    Thank you very much for the snippet!  This works!  Now I just wanted to make sure I'm clear on what has happened:

    By merging the existing dataset into a new blank dataset, only the changes that we made are included.  Therefore, no unnecessary calendar exceptions to cause an error. 

    However, if we did update a calendar exception, when merging to the new dataset that exception would be added and this error would still occur.

    Is that correct?

    Thursday, December 8, 2011 5:27 PM
  • Yes Sara - that is correct.  I haven't tried changing a CalendarException - but would expect it to error - and it may even be unsupported to edit resource calendar exceptions in this way.

    Best regards,

    Brian.


    Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page
    Thursday, December 8, 2011 5:42 PM
    Owner
  • Hi Brian,

     

    I was silently reading and testing your explanation. We solved the CalendarUnusedCalendarException with your advice, but we have another issue, that we don´t know if is a normal issue.

    I open a new thread, could you give us a hand?

    http://social.technet.microsoft.com/Forums/en-US/project2010custprog/thread/43edb253-9405-4674-b486-060e88a2469e

     

    Thanks in advance!

     


    Miguel Soler
    Monday, December 12, 2011 4:10 PM