Read Project Server 2007 Lookup tables values in C# COM Add-in prj

M

Mani

I am using Project Server 2007 and Project professional. I created one
Lookup table Field with Some values. I created a Text Field based on the
Lookup
table. The Text Field will be appear in each task(Task Level Text Custom
Field). If I open the Project Professional I get the lookup table values in
the Text
Field.

I created a COM Add-in using C#, in which it have to read all the Lookup
table values. How I can read all the Lookup table values in the COM Add -in
Project?


Please anybody help me.
 
R

Rod Gill

HI,

I don't think there is a way via the object model, you need to interrogate
the reporting db. For a custom field called GOV Programs, see the View
MSPLT_GOV Programs_UserView in the Reporting db. These Views are created
automatically.

--

Rod Gill
Microsoft MVP for Project

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

Ray McCoppin

The lookup tables and picklists are available via the application object of
Project Pro from the COM-Addin. Below is a small example in C#

public void GetPickList(object Field)
{
Microsoft.Office.Interop.MSProject.Project MyProj;
int x;
try {
if (myproj.Application.CustomFieldValueListGetItem(Field,
MSProject.PjValueListItem.pjValueListValue, 1) != "") {
try {
x = 1;
DoEvents();
while (!ErrTrap) {
if
(myproj.Application.CustomFieldValueListGetItem(Field,
MSProject.PjValueListItem.pjValueListValue, x) != null) {


debug.print(myproj.Application.CustomFieldValueListGetItem(Field,
MSProject.PjValueListItem.pjValueListValue, x));

debug.print(myproj.Application.CustomFieldValueListGetItem(Field,
MSProject.PjValueListItem.pjValueListDescription, x));
x = x + 1;
}
}
}
catch {

}
}
}
catch {
return;
}
}

Hope this Helps

--
Ray McCoppin

http://www.randsmanagement.com
SRS gantt charts
Global Documenter for Project Server 2007
 
M

Mani

Thanks very much for your valuable code.
I have a doubt.. I need to get the ValueList of the Lookup Table "HEALTH".
How i have to typecast and call your function.
will you please help me...
 

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