none
Update Resource Cost rate Using PSI RRS feed

  • Question

  • i am trying to update resource cost rates by using PSI, but the updated rates are not showing "Edit Resource" screen

    i found an article that says that there is "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. "

    http://blogs.technet.com/b/projectsupport/archive/2013/02/12/project-server-resource-rates-changed-with-psi-not-seen-in-project-professional.aspx

    but it doesn't list the complete code on how to update rates and i can't figure out how to combine the code they show with the existing code i have.

    Does anyone knows how to update rates using PSI? any help is appreciated.

    here is what i have so far

     SvcResource.ResourceDataSet.ResourceRatesDataTable rates = updateDs.ResourceRates;

                SvcResource.ResourceDataSet.ResourceRatesRow rates_row = rates.NewResourceRatesRow();

                rates_row.RES_RATE_EFFECTIVE_DATE = new DateTime(2015, 08, 31);
                rates_row.RES_COST_PER_USE = 0;
                rates_row.RES_OVT_RATE = 100;
                rates_row.RES_STD_RATE = 70;
                rates_row.RES_RATE_TABLE = 0;
                rates_row.RES_UID = updateDs.Resources[0].RES_UID;
                rates.AddResourceRatesRow(rates_row);

                                       

    resourceSvc.UpdateResources(updateDs, false, false);

           resourceSvc.CheckInResources(new Guid[] { resourceRow.RES_UID }, false);


    tatiana



    Monday, August 31, 2015 7:43 PM

Answers

  • never mind. it just took a while for the "Edit Resource" page to update for some reason. 

    the following code works for updating rates

     SvcResource.ResourceDataSet.ResourceRatesDataTable rates = updateDs.ResourceRates;

                SvcResource.ResourceDataSet.ResourceRatesRow rates_row = rates.NewResourceRatesRow();

                rates_row.RES_RATE_EFFECTIVE_DATE = new DateTime(2015, 08, 31);
                rates_row.RES_COST_PER_USE = 0;
                rates_row.RES_OVT_RATE = 100;
                rates_row.RES_STD_RATE = 70;
                rates_row.RES_RATE_TABLE = 0;
                rates_row.RES_UID = updateDs.Resources[0].RES_UID;
                rates.AddResourceRatesRow(rates_row);

                                       

    resourceSvc.UpdateResources(updateDs, false, false);

           resourceSvc.CheckInResources(new Guid[] { resourceRow.RES_UID }, false);


    tatiana

    • Marked as answer by tatiana obrien Tuesday, September 1, 2015 1:51 PM
    Tuesday, September 1, 2015 1:51 PM

All replies


  • i can see the rates being updated in Resource Center grid, but when i click on "Edit"  , i still see the old data.

    here is the resource center screenshot

    and here is the "Edit Resource" screen

    and Project Professional 2013 also shows new values.

    so what is going on with "Edit Resource" screen?

    PS. i can see both values in the ResourceRates table


    tatiana




    Monday, August 31, 2015 8:01 PM
  • never mind. it just took a while for the "Edit Resource" page to update for some reason. 

    the following code works for updating rates

     SvcResource.ResourceDataSet.ResourceRatesDataTable rates = updateDs.ResourceRates;

                SvcResource.ResourceDataSet.ResourceRatesRow rates_row = rates.NewResourceRatesRow();

                rates_row.RES_RATE_EFFECTIVE_DATE = new DateTime(2015, 08, 31);
                rates_row.RES_COST_PER_USE = 0;
                rates_row.RES_OVT_RATE = 100;
                rates_row.RES_STD_RATE = 70;
                rates_row.RES_RATE_TABLE = 0;
                rates_row.RES_UID = updateDs.Resources[0].RES_UID;
                rates.AddResourceRatesRow(rates_row);

                                       

    resourceSvc.UpdateResources(updateDs, false, false);

           resourceSvc.CheckInResources(new Guid[] { resourceRow.RES_UID }, false);


    tatiana

    • Marked as answer by tatiana obrien Tuesday, September 1, 2015 1:51 PM
    Tuesday, September 1, 2015 1:51 PM
  • never mind. it just took a while for the "Edit Resource" page to update for some reason. 

    the following code works for updating rates

     SvcResource.ResourceDataSet.ResourceRatesDataTable rates = updateDs.ResourceRates;

                SvcResource.ResourceDataSet.ResourceRatesRow rates_row = rates.NewResourceRatesRow();

                rates_row.RES_RATE_EFFECTIVE_DATE = new DateTime(2015, 08, 31);
                rates_row.RES_COST_PER_USE = 0;
                rates_row.RES_OVT_RATE = 100;
                rates_row.RES_STD_RATE = 70;
                rates_row.RES_RATE_TABLE = 0;
                rates_row.RES_UID = updateDs.Resources[0].RES_UID;
                rates.AddResourceRatesRow(rates_row);

                                       

    resourceSvc.UpdateResources(updateDs, false, false);

           resourceSvc.CheckInResources(new Guid[] { resourceRow.RES_UID }, false);


    tatiana

    Hi Tatiana,

    ¿How do you declare  resourceSvc  in your code?

    Friday, June 23, 2017 10:57 AM