Question : Any way to calculcate Work field in MS Project

Hi Everyone,

I am quite stuck trying to do something with MS Project and hope someone can help. Maybe there is an easy way to do this but if there is I can't figure it out.

 Most of the tasks in my project are software testing tasks for a feature of a product. Each testing task must be run on several configurations. The number of configurations each test will be run on and the depth of testing on each configuration will be quite dynamic over the course of the project. To try and accommodate this I have added some custom fields to the tasks, here is a simple example of custom fields for a task "Test FeatureX":

Config1 (Text1): Win7
Config1Depth (Number1): 1
Config2 (Text2): WinXP
Config2Depth (Number2): .5
ExecutionTime (Duration1): 8 hrs
TotalTime (Duration2): [ExecutionTime] * (Config1Depth+Config2Depth)

 So based on the number of configurations to be tested, the depth of testing on each configuration, and the execution time per configuration I calculate a TotalTime field which represents the total time needed to execute tests for the feature across all configurations at the planned depth.

What I would like to do now, and is my main problem is that I want to use the Calculated TotalTime value as the "Work" Duration for the task. I know Project's time calculations are fundamentally based on Duration=Work/Units so I somehow need to get my calculated value of TotalTime to be used as the "Work" value in this equation. I have tried just entering [TotalTime] in for the Work value but project will not accept it.

Hope this explains my problem well enough. Any help is appreciated.

Thanks!

Answer : Any way to calculcate Work field in MS Project

I'm not sure I understand your clarification request...do you want to use a code like this?

    oTask.Work = oTask.TotalTime

This doesn't work, you can only reference a field as a builtin property (Duration2) of the task object (oTask) OR use the relabeled name for a custom field by using this:

   oTask.GetField(FieldNameToFieldConstant("TotalTime"))

This only works if you relabeled the field, e.g. Duration2 in the field properties where you set the formula!

Thomas
Random Solutions  
 
programming4us programming4us