Using Task IDs in Custom Field Functions

S

Scott Mitchell

I'd like to setup a custom number field that displays a value from a
different task.

For example, I have a custom number field name "Parent Task ID". For
a task, I type the ID value of another task into this field. Then, I
want a "Parent Task Total Work" custom field that shows the Work
amount from the corresponding Parent Task. A sample of the desired
output:

TaskID Work ParentTaskID ParentTaskTotalWork
1 40h 0 0
2 20h 0 0
3 8h 1 40h
4 16h 2 20h

Any ideas on how to make this happen (extra credit for answers that
don't use macros).

Thanks,
Scott
 
J

Jack D.

Scott said:
I'd like to setup a custom number field that displays a value from a
different task.

For example, I have a custom number field name "Parent Task ID". For
a task, I type the ID value of another task into this field. Then, I
want a "Parent Task Total Work" custom field that shows the Work
amount from the corresponding Parent Task. A sample of the desired
output:

TaskID Work ParentTaskID ParentTaskTotalWork
1 40h 0 0
2 20h 0 0
3 8h 1 40h
4 16h 2 20h

Any ideas on how to make this happen (extra credit for answers that
don't use macros).

Thanks,
Scott

Can not be done without a macro. With a macro it is quite simple.
No need to put the parent task ID in if the tasks are properly indented.
This puts the parent task total work into the text5 field for each task.

Sub foo()
Dim t, pt As Task
For Each t In ActiveProject.Tasks
t.Text5 = t.OutlineParent.Work
Next t
End Sub

I can't figure out why you would want to do this however.
Maybe if you explain someone can suggest a better way to go about it.
--
Please try to keep replies in this group. I do check e-mail, but only
infrequently. For Macros and other things check http://masamiki.com/project

-Jack Dahlgren, Project MVP
email: J -at- eM Vee Pee S dot COM


+++++++++++++++++++
 
S

Scott Mitchell

Suppose you wanted to see the specific percentage of the summary task
that each detail tasks includes. For example:

Task Work PercentOfSummaryTask
1 40h n/a, this is the summary task
2 4h 10%
3 10h 25%
4 20h 50%
5 6h 15%

Any other way to do that besides a macro?

- Scott
 
J

Jack D.

Scott said:
Suppose you wanted to see the specific percentage of the summary task
that each detail tasks includes. For example:

Task Work PercentOfSummaryTask
1 40h n/a, this is the summary task
2 4h 10%
3 10h 25%
4 20h 50%
5 6h 15%

Any other way to do that besides a macro?

- Scott

No. Except for a few project level properties, a custom formula for any task
can only work with information from that specific task. It can not reference
information from predecessors or parents etc.

A macro to do what you want is quite simple.

You might want to look at the information I have on calculated fields and
macros on my site.

--
Please try to keep replies in this group. I do check e-mail, but only
infrequently.
For Macros and other things check http://masamiki.com/project

-Jack Dahlgren, Project MVP
email: J -at- eM Vee Pee S dot COM


+++++++++++++++++++
 
Top