共用方式為


CustomFields.ReadCustomFieldsByEntity 方法

會取得所有企業自訂欄位指定的實體 (專案、 資源或任務)。

命名空間:  WebSvcCustomFields
組件:  ProjectServerServices (在 ProjectServerServices.dll 中)

語法

'宣告
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/CustomFields/ReadCustomFieldsByEntity", RequestNamespace := "https://schemas.microsoft.com/office/project/server/webservices/CustomFields/",  _
    ResponseNamespace := "https://schemas.microsoft.com/office/project/server/webservices/CustomFields/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function ReadCustomFieldsByEntity ( _
    entityUid As Guid _
) As CustomFieldDataSet
'用途
Dim instance As CustomFields
Dim entityUid As Guid
Dim returnValue As CustomFieldDataSet

returnValue = instance.ReadCustomFieldsByEntity(entityUid)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/CustomFields/ReadCustomFieldsByEntity", RequestNamespace = "https://schemas.microsoft.com/office/project/server/webservices/CustomFields/", 
    ResponseNamespace = "https://schemas.microsoft.com/office/project/server/webservices/CustomFields/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public CustomFieldDataSet ReadCustomFieldsByEntity(
    Guid entityUid
)

參數

  • entityUid
    類型:System.Guid

    自訂欄位的專案、 資源或任務實體的 GUID。

傳回值

類型:WebSvcCustomFields.CustomFieldDataSet
CustomFieldDataSet包含專案、 資源或任務的entityUid參數所指定的所有自訂欄位的資料。

備註

若要取得所有資源自訂欄位,例如Microsoft.Office.Project.Server.Library組件中使用EntityCollection.Entities屬性的資源實體的 GUID。

秘訣秘訣

ReadCustomFieldsByEntity方法會略過執行 Project Server 之電腦的地區設定。ReadCustomFieldsByEntity2(Guid)方法會傳回公式的計算自訂欄位] 和 [圖形標記的地區設定相關的值。

Project Server 權限

權限

描述

LogOnToProjectServerFromProjectProfessional

可讓使用者從 Project Professional 連線至 Project Server 資料庫。通用權限。

ManageEnterpriseCustomFields

可讓使用者修改企業自訂欄位與查閱表格值的定義。通用權限。

ManageUsersAndGroups

可讓使用者管理 Project Server 使用者和群組。通用權限。

NewProject

可讓使用者建立一個專案。通用權限。

ViewResourceCenter

可讓使用者檢視資源分派資料。通用權限。

ManageWorkflow

可讓使用者管理工作流程。通用權限。

範例

下列程式碼片段會傳回所有資源自訂欄位的CustomFieldDataSet.CustomFieldsRow物件CustomFieldDataSet 。WebSvcCustomFields是參照的任意名稱 CustomFields.asmx web 服務。

using PSLibrary = Microsoft.Office.Project.Server.Library;
. . .
public static WebSvcCustomFields.CustomFields customFields =
    new WebSvcCustomFields.CustomFields();
. . .
string resourceEntity = PSLibrary.EntityCollection.Entities.ResourceEntity.UniqueId;

WebSvcCustomFields.CustomFieldDataSet cfDs = customFields.ReadCustomFieldsByEntity(
    new Guid(resourceEntity));
. . .

請參閱

參照

CustomFields 類別

CustomFields 成員

WebSvcCustomFields 命名空間

ReadCustomFieldsByEntity2(Guid)