Inserting Cost values into custom PS Cost fields

May 16, 2008 at 2:45 PM

The use of custom cost/duration fields in Microsoft Office Project Server 2007 is not especially common.  However, EPMSync (and ProjTool in the SDK) do not correctly insert cost and duration values into Project Server.

  1. When adding Cost values to the PSI, the incoming value should be multiplied by 100.  This was true in previous versions of Project Server when updating cost values in the database.
  2. Custom Duration fields also have a special multiplier.
  3. Incoming cost values should always be stripped of non-numeric characters (e.g. commas) so as not to get the error "Input string was not in a correct format".

The PWA UI/business layer handles this appropriately, but tools like EPMSync on CodePlex, ProjTool in the SDK, and posted sample code I've seen to insert custom cost/duration values do not.  In fact, they're all copies of each other.  For costs, following the examples results in cost displayed in Project Server being 1% of their real value.

In the SDK there is mention of a multiplier in the Description for Cost data types:
  Value in 1/COST_MULTIPLIER dollars

I would assume COST_MULTIPLIER is a constant or property somewhere but I have never found it anywhere in the SDK/API.  In the case of U.S. dollars this value would be 0.01  If this value does exist in the API, please point it out to me.

Realize also that reading a cost value from the PSI should be divided by 100 (or 1/COST_MULTIPLIER) as well to get its true value.

Could someone please officially post corrections to this in the SDK and on the product team blogs?  The incorrect code examples are getting used as a model of the correct way to do it..

Thanks,
Paul Congdon
Milestone Consulting Group