Rod and Malik,
To clarify, the PSI can edit rates but the way it has to be done differs
from the rest of the PSI.
This code, which you'd expect to work, does not:
Guid _sampleResUid = new
Guid("8e345885-f613-4f61-a49b-5fd22fa064fe");
// Retrieve existing resource data
ResourceSvc.ResourceDataSet _existingWorkRes =
_resourcePsi.ReadResource(_sampleResUid);
// Change rate to $250,000/yr
_existingWorkRes.ResourceRates[0].RES_STD_RATE =
120.19230769230769230769230769231;
// Update Resource
_resourcePsi.CheckOutResources(new Guid[] {_sampleResUid});
_resourcePsi.UpdateResources(_existingWorkRes, false,
false);
_resourcePsi.CheckInResources(new Guid[] {_sampleResUid},
false);
The row in ResourceRates is updated and any subsequent reads from the
PSI show the new rate, but Project Pro will still show the old rate.
In fact, if you check out the resource using Pro and save it, the new
rate you set is overwritten with the old rate.
In order to get this to work, you must run this code:
Guid _sampleResUid = new
Guid("8e345885-f613-4f61-a49b-5fd22fa064fe");
// Retrieve existing resource data
ResourceSvc.ResourceDataSet _existingWorkRes =
_resourcePsi.ReadResource(_sampleResUid);
// Change rate to $250,000/yr
_existingWorkRes.ResourceRates[0].RES_STD_RATE =
120.19230769230769230769230769231;
// Set the corresponding resource row as modified
_existingWorkRes.Resources[0].SetModified();
// Update Resource
_resourcePsi.CheckOutResources(new Guid[] {_sampleResUid});
_resourcePsi.UpdateResources(_existingWorkRes, false,
false);
_resourcePsi.CheckInResources(new Guid[] {_sampleResUid},
false);
The fix is to set the corresponding row in the Resources table as
modified -- then the PSI and Pro both show the new rate.
I touched on this in DM303 at the Project Conference in response to a
question, but didn't go into the workaround.
Regards,
Steve
--
Stephen Sanderlin, Project MVP
VP of Technology
MSProjectExperts
For Project Server Consulting:
http://www.msprojectexperts.com
For Project Server Training:
http://www.projectservertraining.com
Read our blog at:
http://www.projectserverhelp.com