Reading custom field values in PSI (C#)

A

asadim

I have read the SDK notes including the section that talks about using
filters, but haven't been able to find anything for reading CF values. For
example I have a CF called "ABC" for resources and I'd like to read the value
for one of the specific resource "Mr. X"...

The SDK has a function for getting CF names by entity UID, but that's not
helpful. I don't want the field names, I want the CF *values* for a specific
resource, or project, or task (for my case lets just stick to resources).

I am programming in C#. Any help is greatly appreciated.
 
S

Sharry Heberer [MSFT]

The CF values are carried on the entity for which the value is set, so you
would want to read the appropriate entity, in your case - Resources. Call
ReadResource to get the ResourceDataSet populated for that resource (or call
ReadResources to get more than 1 resource). In the ResourceDataSet there is
a table called ResourceCustomFields.

Hope this helps,
Sharry
 
A

asadim

Thanks Sharry. I wish I had posted here earlier! Shortly before you responded
I got it figured out (after hours of experimenting and plenty of
Console.Writing!).
 
A

asadim

I am having troubles reading Task CF values. I know how to read them for
resources (using ReadResource(resGuid)) and for projects (using
ReadProject(projGuid, dataStore)) but can't figure out how to access the
value of a Task CF.

Please advise. Thanks.
 
S

Sharry Heberer [MSFT]

There is a table called TaskCustomFields in the ProjectDataSet. Is that
what you're looking for?

--
This posting is provided "AS IS" with no warranties, and confers no rights.

Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
A

asadim

Exactly! I wonder why is it placed under the Project dataset though...

Thanks alot Sharry. Now everything looks good.
 
S

Sharry Heberer [MSFT]

Tasks are part of projects (there is also a Task table in the project
dataset), so that's why the CF values are also in there. But out of
curiosity - where would you put it?

--
This posting is provided "AS IS" with no warranties, and confers no rights.

Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
A

asadim

Right, thanks. Perhaps I would either put it under Assignments or just create
an individual Task Web Service.
 

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