次の方法で共有


CustomField Class

Includes fields for values of the default enterprise and local custom fields.

Inheritance Hierarchy

System.Object
  Microsoft.Office.Project.Server.Library.CustomField

Namespace:  Microsoft.Office.Project.Server.Library
Assembly:  Microsoft.Office.Project.Server.Library (in Microsoft.Office.Project.Server.Library.dll)

Syntax

'Declaration
Public Class CustomField
'Usage
Dim instance As CustomField
public class CustomField

Remarks

Note

Local custom fields must be created by using Project Professional. You cannot use the PSI to create local custom fields. However, you can use the PSI to read or edit the value of a local custom field.

For a code example that adds a Project Departments custom field to a ProjectDataSet, see QueueCreateProject(Guid, ProjectDataSet, Boolean).

Task and resource custom fields have secondary custom field identification numbers for assignments. The selected values for primary and secondary custom fields can be different. For example, the following procedure shows the difference for a Cost Type resource custom field, where the Cost Type lookup table includes the values "Contractor" and "Construction":

  1. With Microsoft Project Professional 2010 connected to Project Server, create a project.

  2. Add a task T1, and assign a resource R1 to the task.

  3. Open the Resource Usage view, and then add the Cost Type column.

  4. Select Contractor in the Cost Type drop-down list for R1.

  5. Select Construction in the Cost Type drop-down list for T1.

  6. Save and publish the project.

In the Published database for Project Server, the MSP_ASSN_CUSTOM_FIELD_VALUES table for assignment custom fields includes a row that corresponds to the Cost Type assignment custom field. The row includes the following:

  • In the MSP_ASSN_CUSTOM_FIELD_VALUES table, the value of the MD_PROP_UID field for that assignment is 00005A8B-34C0-41E5-BF90-8260AD54A0B9, which is the value of the COST_TYPE_MD_PROP_UID_SECONDARY field.

  • Project Server sets the MD_PROP_ID field in the MSP_ASSN_CUSTOM_FIELD_VALUES table to the value of COST_TYPE_MD_PROP_ID_SECONDARY.

  • The CODE_VALUE field for the Cost Type assignment custom field is the GUID of the "Construction" value in the Cost Type lookup table.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

CustomField Members

Microsoft.Office.Project.Server.Library Namespace