Manipulating Custom fields in Project Server/Professional

B

Bill Ehrreich

I have a number of custom fields defined in Project Server. Each of
these custom fields would be defined as a value list as would be
associated with tasks. The lists of values will be derived from
another SQL Server database (not Project Server database). I have a
few questions regarding the implementation of this in Project Server
and MS Project Professional:

1. While it seems that I can use PDS to update my custom field value
list, is there any reason why I couldn't simply do the update using
SQL Server? I could very easily create a DTS package to query the
other database then update the required records in the appropriate
Project Server table. Would there be any danger of throwing something
off by going straight to the SQL tables rather than using the PDS API?

2. When a user creates a new project using MS Project Professional
(Enterprise Global Template selected), the user will see the custom
fields as listboxes. However, I would I like to be able to limit the
selections available in listbox 2 when a value is selected in listbox
1 as tasks are entered. I am trying to create an add-in for Project
Professional to accomplish this. Unfortunately, I have noticed the
following:

*I have no events to use to attach an event procedure except
Project_Change. I don't have Task_Change, much less a change event
for the listboxes themselves (a BeforeUpdate event would be even
better!). Using Project_Change will be clumsy because it will be
firing most of the time for things that I don't want to trap.

*I can access the values of my custom field listboxes (I can do both
Get and Set) but I can't see how to access/modify the lists behind
them. Does the MS Project object model provide a way?

Thanks for any assistance,

Bill Ehrreich
Hollywood, FL
 
J

Jim Corbin [MSFT]

There are two main disadvantages when you directly access SQL Server instead
of using the PDS (or a PDS extension):

1. You lose the built-in Project Server security (checks if the user can log
on Project Server, and has the necessary permissions).

2. Your SQL Server-based solution will most likely not work in the next
version of Project Server. The next version will support the standard PDS
methods, but PDS extensions (which themselves often directly access SQL
Server after user authentication and authorization) may not.

Regarding the Project object model for task changes, how about
ProjectBeforeTaskChange2 Event, or ProjectBeforeTaskNew2 Event? See example
code in the ProjectBeforeTaskNew Event description in the VB ref in the SDK.
 
B

Bill Ehrreich

Jim,

Thank you for your response.

I solved most of these problems without much difficulty. I'm talking
to Project Server via PWA using a VB6 executable and everything is
going smoothly. Also, I went through the Project object model and
found the events you mentioned under the application object and
created the necessary Class and event procedures. It all works fine.

The only remaining problem I have is that I need to modify how the
value lists appear at runtime so that if a user makes a selection from
list 1, he/she only sees certain choices in list 2. I found methods
such as Application.CustomFieldValueListGetItem and
Application.CustomFieldValueListDelete but I'm not sure if these
actually change the value lists in the Enterprise Global Template,
which I don't want to do here. I've tried an experiment with
CustomFieldValueListDelete but errors kept me from seeing whether my
value list was affected locally versus globally. My workaround was to
create a method that automatically validates the choice made in list 2
based on the choice made in list 1, but it would be far easier for the
user if I could modify list 2 when a list 1 value is selected.

Do you have any suggestions?

Thanks,

Bill
 
E

Earl Lewis

Bill,

What kind of control are you using for list1 and list2? If I'm not mistaken the individual controls should have 'change' events - so when list1_change fires you can populate list2 with whatever you have access to, i.e. a list of items based on some sort of filtering from the list1 selected value.

Hope that helps.

Earl
Jim,

Thank you for your response.

I solved most of these problems without much difficulty. I'm talking
to Project Server via PWA using a VB6 executable and everything is
going smoothly. Also, I went through the Project object model and
found the events you mentioned under the application object and
created the necessary Class and event procedures. It all works fine.

The only remaining problem I have is that I need to modify how the
value lists appear at runtime so that if a user makes a selection from
list 1, he/she only sees certain choices in list 2. I found methods
such as Application.CustomFieldValueListGetItem and
Application.CustomFieldValueListDelete but I'm not sure if these
actually change the value lists in the Enterprise Global Template,
which I don't want to do here. I've tried an experiment with
CustomFieldValueListDelete but errors kept me from seeing whether my
value list was affected locally versus globally. My workaround was to
create a method that automatically validates the choice made in list 2
based on the choice made in list 1, but it would be far easier for the
user if I could modify list 2 when a list 1 value is selected.

Do you have any suggestions?

Thanks,

Bill
 
B

Bill Ehrreich

Earl,

I wasn't using my own controls. The lists appear automatically in the
task information and they are derived from the value lists in the
global template.

The problem is not that I can't trap the event, but that I have no way
to tailor the lists.

I found a workaround by creating my own popup form with my own
comboboxes that I populate as I wish.

Bill
 
E

Earl Lewis

Bill,

I assumed you were creating your own form - so I thought the solution was straightforward - and it was once you did that.

Earl
Earl,

I wasn't using my own controls. The lists appear automatically in the
task information and they are derived from the value lists in the
global template.

The problem is not that I can't trap the event, but that I have no way
to tailor the lists.

I found a workaround by creating my own popup form with my own
comboboxes that I populate as I wish.

Bill
 
B

Bill Ehrreich

Yes. Everything seems to be working now except one little thing...

When I view a project in PWA, the custom fields display the values
rather than the descriptions or phonetics. I would like to display
the description and not the value or the description concatenated with
the value (as does MS Project Professional). I can't find a way to
easily change this in my Admin, Views settings in PWA.

Do you have any suggestions? I'm hoping that I don't have to do a
customization to the grid control to get this to work.

Bill
 
B

Bill Ehrreich

Should I assume that nobody knows the answer to this one? To
reiterate, how do I display the description or phonetic rather than
the value for a custom value field in PWA and Project Professional. I
can see the description while I'm selecting from the listbox, but I
can only see the number once a selection has been made.

Thanks,

Bill E.
 
B

billmiami2

I'm still without an answer to this one. I need to display the
description in
the combo box rather than the number (or the concatenation of the two).
Does
anyone know how I can do this? If not, can anyone suggest a resource
that might
help me find the answer?

Thanks,

Bill Ehrreich
 

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