Retrieving Enterprise Project Types using Project Server Interface

岁酱吖の 提交于 2019-12-12 01:36:57

问题


I am currently building an app to programatically create projects in Microsoft Project Server using the web services exposed through the Project Server Interface (PSI).

I am able to create a project with an Enterprise Project Type using the QueueCreateProject method, however, I need to specify the GUID of the EPT which I don't want to hard code into the code.

Is there another web service or way to get the GUID of a specific EPT found by its name?

Also, can the same be done for custom fields in the same way?


回答1:


I think what you're looking for is PSI Filter parameters. Check out this post for an example of retrieving the Guid of a custom field.

Really, I think the key is setting the filter criteria:

cfFilter.Criteria = new PSLibrary.Filter.FieldOperator(equal, nameColumn, customFieldName);

Where nameColumn is cfDataSet.CustomFields.MD_PROP_NAMEColumn.ColumnName and customFieldName is a value you pass in.

If you are like me, you want to do this for a lot of fields. I used a filter to query all the field names and MD_PROP_UID's and then just put it in a hashtable so I don't have to keep making PSI calls.

Disclaimer: I use 2007 but I'm assuming it is mostly the same for custom fields (not for the EPT part which I didn't include).




回答2:


Here is an answer: https://stackoverflow.com/a/12267251/1594383

In short: the methods are available from Workflow service.



来源:https://stackoverflow.com/questions/7342983/retrieving-enterprise-project-types-using-project-server-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!