Is There a way to get a List of all the Enterprise Fields a user on Project Server has In Use?

284 Views Asked by At

I'm building a MS Project VSTO tool (written in C#) that in many instances needs to either read or write data from a field in MS Project. Since I don't always know what field will contain the data I need, I many times need to allow the user the option to select the field they want. Getting all the basic fields is easy, my issue arises if a user is in a Project Server environment and using Enterprise fields. So my question is 2 fold:

  1. Is there a way to check if the user is in a Project Server environment?
  2. Is there a way to easily get all of the custom enterprise fields that are being used in MS Project? I'd like to be able to capture these fields in a collection like a list or array.
1

There are 1 best solutions below

0
On BEST ANSWER

Is there a way to check if the user is in a Project Server environment?

Look at the collection of Profiles to see if there is a project server one and check its ConnectionState to see if it's connected to a project server.

Is there a way to easily get all of the custom enterprise fields that are being used in MS Project? I'd like to be able to capture these fields in a collection like a list or array.

If you have access to the project server, take a look at this page, Accessing Project Online enterprise custom fields. Without access to the server I suggest:

  • Loop through all tables and their fields to find enterprise ones.
  • Allow the user to enter the name of enterprise fields and store that information for future use so that it's a one-time 'setup' for the user.