Export (0) Print
Expand All

ProjectCodeValuesUpdate Method

Office 2003

Description

Updates one or more enterprise project custom fields and outline codes for a project in Microsoft Office Project Server 2003. ProjectCodeValuesUpdate also updates values in fields that contain value lists, but does not update custom fields with graphical indicators.

Note   ProjectCodeValuesUpdate does not update enterprise task custom fields or outline codes. Updating task custom fields and outline codes requires a PDS extension. For a sample PDS extension that updates enterprise task custom fields, see the EnterpriseCustomFieldValueUpdate method in the Solution Starter: SAP Connector to Project Server 2003 download, in the Microsoft Download Center.

Syntax

<Request>
   <ProjectCodeValuesUpdate>
      <ProjectID></ProjectID>
      <ProjectName></ProjectName>
      <AutoCheckin></AutoCheckin>
      <Columns>
         <Column>
            <UID></UID>
            <Value></Value>         <!--Custom Field -->
            <ValueUID></ValueUID>   <!--Outline Code -->
         </Column>
      </Columns>
   </ProjectCodeValuesUpdate>
</Request>

Parameters

For an example of how to use ProjectCodeValuesUpdate, see the Example section.

ProjectID or ProjectName

Required. Either ProjectID or ProjectName is required. If ProjectID is specified, the PDS checks access to that ProjectID and ignores ProjectName.

ProjectName is the project name as stored in the PROJ_NAME field of the MSP_PROJECTS table (the concatenation of the project identifier and the version name, separated by a period).

AutoCheckin

Optional. If AutoCheckin is specified with a value of 1, the PDS also attempts to check the project in when completed.

Columns

Required. Contains one or more Column parameters that specify the enterprise outline codes and the enterprise custom fields with update values.

The UID is required for each column, and must match the field type. Conversion values for column UID are listed in Field ID Values for Enterprise Custom Fields. See the limitations in Remarks.

Value is used for an enterprise custom field, and ValueUID is used for an enterprise outline code.

Return Value

If the enterprise outline code and custom field values are successfully updated and the project is checked-in (if requested), the method returns a successful HRESULT and STATUS. If the requested project check-in fails, or the information update fails, the entire request fails, and an appropriate error code is returned.

<Reply>
   <HRESULT></HRESULT>
   <STATUS></STATUS>
   <UserName></UserName>
</Reply>

Remarks

The PDS checks Project Server security for the currently logged-on user, and determines if that user is a valid Project Server user. The PDS also ensures that the project is checked out to the current user. The PDS updates the specified enterprise outline code and custom field values in the database.

The PDS updates only valid enterprise outline code fields, and the enterprise custom field values that are not graphical indicators. The PDS also makes the same updates in the Project view tables, in order to maintain consistency between the Project tables and the Project drill-down views in Project Web Access.

Note   ProjectCodeValuesUpdate does not support enterprise custom fields for work, flag, or duration. For example, if you include a UID of 188744649, which corresponds to Task Enterprise Project Flag1, ProjectCodeValuesUpdate does not update that enterprise custom field and does not return an error. You need to use Project Professional to update work, flag, or duration enterprise project custom fields.

ProjectCodeValuesUpdate does not revoke access to the project in the security table (see ProjectsAccessCompleted).

ProjectCodeValuesUpdate is valid for a single version of one project at a time. To update multiple projects, you must make multiple calls to this method.

Example

To use ProjectCodeValuesUpdate, first use ProjectsCheckout. Use ProjectsCheckin when the update is completed. The following example shows the XML requests necessary to update the Task Enterprise Project Text1 custom field (field ID 188744729) in a project named Test2.

<!-- Step 1. Check out the project -->

<Request>
   <ProjectsCheckout>
      <Project>
         <ProjectName>test2.Published</ProjectName>
      </Project>
   </ProjectsCheckout>
</Request>

<!-- Step 2. Update the custom enterprise project text field (field UID 188744729) -->

<Request>
   <ProjectCodeValuesUpdate>
      <ProjectName>test2.Published</ProjectName>
      <Columns>
         <Column>
            <UID>188744729</UID>
            <Value>test...test...test...test...test</Value>
         </Column>
      </Columns>
   </ProjectCodeValuesUpdate>
</Request>

<!-- Step 3. Check in the project -->

<Request>
   <ProjectsCheckin>
      <Project>
         <ProjectName>test2.Published</ProjectName>
      </Project>
   </ProjectsCheckin>
</Request>

 

Show:
© 2014 Microsoft