Cascade Skyline - with Microsoft Logo and Project Support header - author Brian Smith

Working with Project Server datasets and the web services - don't AcceptChanges!

Working with Project Server datasets and the web services - don't AcceptChanges!

Rate This
  • Comments 42

I thought this was one worth mentioning to a wider audience in case it catches others out.  One of our customer had written some code to update data in the timesheet using the PSI.  All seemed to be working OK, but no numbers changed.  You could even debug in Visual Studio and use the cool data visualizer to see the dataset and watch the changes - but even though the call worked and the queue showed a successful update the timesheet didn't reflect the changes.  The right dataset was also being passed to the final web service - in this case the QueueUpdateTimesheet method of the Timesheet web service.

I then noticed that the customer had an ADO.NET "AcceptChanges" call on the dataset before the call to the web service.  This was breaking the update as the web service is expecting the dataset to have a delta holding the changes from the original read of the timehseet dataset.  The AcceptChanges is used in ADO.NET to commit changes in the dataset - but the delta then disappears.  So even though the dataset was different to that originally read from the PSI call, it didn't have the deltas - so no changes were made to the original (different) data.  Simply removing this line got everything working again and the changes were then visible in the timesheet control of PWA!

Technorati Tags:

 

Leave a Comment
  • Please add 4 and 6 and type the answer here:
  • Post
  • Thks Brian!

    An option, and maybe more correct, is access enterprise calendar to retrieve hours per day but I think that calendar information is just binary data and I can't find a way to read that information.

    Can you help me?

    Thks

    Nuno Coelho

    PT

  • Hi Brian, one more time!

    I'm having problems with calendars because I want to read some information to make an integration with a human resource software.

    You know how to read that information or a place were some one can help me?

    Thks one more time

    Nuno Coelho

    PT

  • Sorry Nuno,

    There isn't a way to crack the binary for calendar information.  You may be able to do something via VBA in the client, and then push the data into a more readable format, but I haven't tried this.

    Best regards,

    Brian.

  • Hi Brian!

    Are you saying that we cannot access any calendar information programatically?

    That's a huge flaw in my opinion...

    Thks

    Nuno Coelho

    PT

  • You can access the calendar exceptions Nuno - just you can't tell what they are exceptions from...  And I don't disagree with you.

    Best regards,

    Brian.

  • Hi Brian one more time!

    I have made a standalone windows form application and I want to make acessible from an activex.

    When a user acess to an option on pwa an alert will ask user to download the application.

    You know any tutorial with that type of informations?

    Thks

    Nuno

    PT

  • Hi,

    I've been looking all over the net and SDK's but can't find out how to insert items into a resource calendar programatically.

    Basically we have a leave system, when someone books leave, we'd like to update the resource calendar and make that resource as not available for the time period in which they are on leave.

    A code sample or some help on this will be great.

  • Hi Greg, I don't have a code sample to hand but can give some quick pointers.  When entering non-working time through the timesheet then this goes into the resources calendar as a calendar exception.  So doing this programmatically is one option.  Also this note is from the SDK about the Calendars web service:

    The UpdateCalendars method supports only calendar exceptions for enterprise calendars, not all enterprise calendar functionality in Microsoft Office Project Server 2007. You can add or delete time off for Project Server resources as calendar exceptions by using the [Resource Web service] namespace.

    This method does not modify enterprise calendar exceptions. If updates are required, you must delete and recreate calendar exceptions.

    Work weeks in enterprise calendars are not normalized in the Published database. Work week information is stored as binary data, so there are no direct queries available to load all calendar information to a CalendarDataSet.

    So the Resource web service is probably the best way to go.

    Best regards,

    Brian.

  • Hi

    I dont that my comment is much related to this topic but im hitting a dead ends , i want to create Material resources and i want to set the standard rate for this resource or i want to loop through the resources i already have and update the standard rate for them ,i tried to look for the property RES_Cost or RES_StandardRate but i found nothing can you help me with this please .

    Best Regards

    Malik Al-Shayeb

  • I wish to understand if we could integrate Hyperion with Project server 2007 for time management. Client wants to use Hyperion for time management and import export within these systems. my email id is sabby777@gmail.com

  • Cheers,

    Anyone know of the proper way to edit Resource Plan assignments using the PSI?

    I can retrieve the resource plan using something like this:

    ResourcePlanDataSet resplans = planService.ReadResourcePlan(String.Empty,

                       new Guid(e.CommandArgument.ToString()), DateTime.Now, DateTime.Now.AddMonths(1), (short)TimeScaleClass.TimeScale.Days, true, false);

    But question #1: what is the proper way to access the actual assignments? I can find the assignments in this array: resplans.PlanResources[0].ItemArray (first resource), but is this the only way?

    Question #2: what if I want to update the values? Making changes to the values in ItemArray doesn't work.. nothing gets changed and nothing changes when looking at the object in the data visualizer.

    Best regards :)

  • To Maik:

    I had the exact same problem with the RemoveCalendarExceptionsRow method and finally worked out a solution for it, i created a small blogpost about it here if you (and others) are interested:

    technicaltrix.blogspot.dk/.../project-server-2010-psi-calendar.html

    --Reply to

    --Maik:

    --i´m trying to delete a CalendarExceptionsRow from the ResourceDataSet.CalendarExceptions table. But the

    --RemoveCalendarExceptionsRow() and Delete() methods don´t work for me.

Page 3 of 3 (42 items) 123