Microsoft Project Support Blog

The place to come for Microsoft Project, Microsoft Project Server and Project Online support topics

Project Server: Resource rates changed with PSI not seen in Project Professional

Project Server: Resource rates changed with PSI not seen in Project Professional

  • Comments 5
  • Likes

This is an issue that was found by one of our premier customers when making an annual rate change to their resource rates using a custom application and the Resource PSI web service.  They were finding that the updated rates were not present when they opened plans after the rate change – but if they created a new local cache by adding a new profile/account pointing to the same PWA then they would see the new rates.

We tracked the problem down to a bug in the PSI whereby when an update is made using UpdateResources and it only affects the ResourceRatesDataTable, and none of the other data tables in the dataset, then we were not triggering the versioning increment for the resource.  This meant that when Project Professional was loaded then if it already had data for the resource then it would not refresh – as it incorrectly thought it already had the right data.

This also applies to Project Server 2007, Project Server 2010 and Project Server 2013.  We will be updating the SDK with the following  workaround, and it is quite simply.  And this isn’t scheduled for a fix in the near future, so if you are using the PSI to update rates then worth reading on.

Just a short snippet of code just at the point where the UpdateResources is called for the dataset

  
SvcResource.ResourceDataSet changesDS = new SvcResource.ResourceDataSet();
changesDS.Resources.Merge(resDs.Tables[resDs.Resources.TableName], true);
changesDS.ResourceRates.Merge(resDs.Tables[resDs.ResourceRates.TableName], true);
_psi.ResourceClient.UpdateResources(changesDS, false, true);
 

The workaround would be to add a line to set another part of the dataset as modified

SvcResource.ResourceDataSet changesDS = new SvcResource.ResourceDataSet();
changesDS.Resources.Merge(resDs.Tables[resDs.Resources.TableName], true);
changesDS.ResourceRates.Merge(resDs.Tables[resDs.ResourceRates.TableName], true);
 
changesDS.Resources.FindByRES_UID(curRes.RES_UID).SetModified();
 
_psi.ResourceClient.UpdateResources(changesDS, false, true);

 

In this case there is now a .SetModified() for the main Resources data table for our updated resource.  This is enough to let ensure the revision counter for the resource gets updated and then Project Professional will know to reload the resource when next it opens.

Sorry for the inconvenience this bug might cause you.

Comments
  • Very useful! Thank you!

  • Just if I could ask - where to update this code? I have same issues for case: PS2010<->Dynamics AX 2010; rates changed in one of PS tables are not being seen in project Professional

  • Hi,

    This bug has been fixed in some KB or Service Pack?

  • where to update this code?

  • Please get me the full code to change resource stanadard rate? using object mocel.Plzzzzzzzzzz help on this.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment