none
Remove Resource Calendar Exceptions RRS feed

  • Question

  • Hi,

    I want to remove the Resource Calendar Exception using the Resource.asmx.

    It is not happening 

    I used the code from this thread

    Please help me.


    Thanks, Parth

    Thursday, February 20, 2014 1:42 PM

All replies

  • Can you provide a screen shot or more information about the error.  Have you looked into the ULS log?  Can you dump records based on the correlation ID?

    Cheers!


    Michael Wharton, MVP, MBA, PMP, MCT, MCTS, MCSD, MCSE+I, MCDBA
    Website http://www.WhartonComputer.com
    Blog http://MyProjectExpert.com contains my field notes and SQL queries

    Friday, February 21, 2014 12:10 AM
    Moderator
  • No error what so ever, it goes nicely smoothly :) But resource calendar exception does not go through, and even i have observed that resource does not checked in when i call the ResourceUpdate Method for PSI.

    Below is the code i have....

    Guid ResUid = new Guid("df09d853-568a-e311-a36b-00155d98782c");
    			WbSvcResource.Resource res = new WbSvcResource.Resource (PWAUrl);
    			res.Url=PWAUrl +  "/_vti_bin/psi/Resource.asmx";
    			res.CookieContainer = ExtractAuthCookiesFromUrl (PWAUrl);
    			WbSvcResource.ResourceDataSet rds;
    			rds = res.ReadResource (ResUid);
    			try
    			{
    			res.CheckOutResources(new Guid[] { ResUid });
    
    			//WbSvcResource.ResourceDataSet.CalendarExceptionsRow r = rds.CalendarExceptions;
    			foreach (WbSvcResource.ResourceDataSet.CalendarExceptionsRow item in rds.CalendarExceptions) 
    			{
    				if (item.Name == "Test") {
    rds.CalendarExceptions.RemoveCalendarExceptionsRow (item);
    					break;
    				}
    			}
    							res.UpdateResources (rds, false, true);
    			}
    			catch(Exception ex) {
    				Console.WriteLine (ex.ToString ());
    			}
    Please suggest.


    Thanks, Parth

    Friday, February 21, 2014 3:58 AM
  • Can anyone suggest me what is wrong wth this!?

    Thanks, Parth

    Monday, February 24, 2014 7:22 AM
  • Try it:

    foreach (DataRow row in projectResource.CalendarExceptions.Rows)
    {
    row.Delete();
    }

    service.UpdateResources(projectResource, false, true);

    It worked for me.

    Regards

    Wednesday, May 14, 2014 7:52 PM