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


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 (6)

  1. anonymouscommenter says:

    Very useful! Thank you!

  2. anonymouscommenter says:

    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

  3. anonymouscommenter says:

    Hi,

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

  4. anonymouscommenter says:

    where to update this code?

  5. anonymouscommenter says:

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

  6. anonymouscommenter says:

    Hi All,

    Please provide me details as How to get the list of projects in draft so that we can archive them by selecting any one.

    e.g. in a PWA instance we have 10 projects added but we made changes to any 3 then there are onlly 3 projects in draft mode in project server.

    My requirement is to dislay these 3 project on a web page and select any one to archive it.

    Any help will be appriciated.

    Thanks,
    Manoj

Skip to main content