GUID for TaskPercentCompleted?

Q

Quized again

MOPS2007.
How would I determine what the UID is for pre-existing task fields like %
Complete (TaskPercentCompleted) and other fields?

I have VBA code that reads the list of task fields from the column headings
in MSP_EpmTask_UserView and populates a drop down list for selection. Upon
selection, the code then creates a table and view in MSP Pro. The problem is
that TaskPercentCompleted is listed in MSP_EpmTask_UserView where I derive my
task field list for the drop-down selector. But my code does not know how to
insert TaskPercentCompleted in the MSP client view because MSP Pro uses "%
Complete". So I thought I would try to use fields UIDs instead. Good approach?

Thank you.
 
R

Rod Gill

No different I'm afraid. There are no Field ID's in the UserView View. You
need to manually create a lookup function or select statement for all field
names that generate an error in your code.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
Q

Quized again

Thanks Rod. Is this problem that there is no GUID for the field I want or
that the GUID exists elsewhere?
If there is a GUID at all, would I be able to use it to programmatically
create a table for a view in MSP client? I am thinking along the lines of
telling the SW to insert TaskName, then inert GUID x, then insert
TaskStart,....

Thank you.
 
R

Rod Gill

HI,

There is no relationship I know of that will allow you to lookup the Column
name or ID of any field in the reporting db. Simplest solution is:

Dim FieldName as String
Dim FieldConstant as long
On Error Resume Next
Err.Clear
FieldConstant =application.FieldNameToFieldConstant(FieldName,pjTask)
If Err then
Select Case FieldName 'Field Name not valid
Case "TaskPercentCompleted"
FieldName= "% Complete"
Case "TaskPercentWorkCompleted"
FieldName= "% Work Complete"
End Select

Add extra case statements for all fieldnames that are different.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
Q

Quized again

Ok, thanks again Rod. We have begun to use your approach but were hoping for
a universal ID. Darn!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top