ResourceCodeValues Method

Description

The PDS gets a list of the active enterprise outline code structures for a resource, including enterprise outline code values and enterprise custom field values, from Microsoft Office Project Server 2003. It optionally includes multi-value resource outline codes and value lists.

Syntax

<Request>
   <ResourceCodeValues>
      <ResourceUID></ResourceUID>
      <ResourceName></ResourceName>
      <ReturnStructures></ReturnStructures>
      <AutoCheckout></AutoCheckout>
      <IncludeValueLists></IncludeValueLists>      <IncludeCodeDetails></IncludeCodeDetails>      <IncludeRCMV></IncludeRCMV>
   </ResourceCodeValues>
</Request>

Parameters

ResourceUID* or *ResourceName

Required. Either the resource ID or the resource name is required. If ResourceUID is specified, ResourceName is ignored.

ReturnStructures

Optional. If ReturnStructures is set to 1, the PDS also returns outline code value list structures and values.

AutoCheckout

Optional. If AutoCheckout is set to 1, the PDS attempts to check out the resource.

IncludeValueLists

Optional. If IncludeValueLists is set to 1, the PDS includes enterprise custom fields with value lists in the reply. The**default is 0.

IncludeCodeDetails

Optional. If IncludeCodeDetails is set to 1, the PDS includes binary values for Warpable and SelectLeafOnly for each outline code in the reply.

IncludeRCMV

Optional. If IncludeRCMV is set to 1, then the reply includes multi-value resource outline codes. The default is 0.

Return Value

If the PDS successfully gets the enterprise code values, and the resource checkout is successful (if requested), ResourceCodeValues returns a successful HRESULT and STATUS. The return includes the enterprise outline code field values for the resource, and the enterprise custom field values (not the graphical indicators).

If ReturnStructures is specified, the PDS returns the code structures as if EnterpriseOutlineCodes is called with a CodeType of 1. If the requested resource checkout or information collection fails, the entire request fails, and an appropriate error code is returned. If ResourceUID is specified, the return includes ResourceName; if ResourceName is specified, the return includes ResourceUID.

The following reply syntax shows results when IncludeRCMV is set to 0, and when it is set to 1:

<Reply>
   <HRESULT></HRESULT>
   <STATUS></STATUS>
   <UserName></UserName>
   <ResourceCodeValues>
      <ResourceUID></ResourceUID>
      <ResourceName></ResourceName>
      <ResourceCheckedOut></ResourceCheckedOut>
      <ResourceCheckedOutUser></ResourceCheckedOutUser>
      <CurrencySymbol></CurrencySymbol>
      <CurrencyPosition></CurrencyPosition>
      <CurrencyDigits></CurrencyDigits>
      <Columns>
         <!--Column XML syntax for EROC and custom fields -->         <!--IncludeRCMV is not included or set to 0 in the request -->
         <Column>
            <Type></Type>
            <UID></UID>
            <Name></Name>
            <SelectionRequired></SelectionRequired>
            <Warpable></Warpable>            <SelectLeafOnly></SelectLeafOnly>
            <ValueUID></ValueUID>
            <Value></Value>
            <ValueList>
               <ValueItem>
                  <ValueUID></ValueUID>   <!--EROC -->                  <Phonetic></Phonetic>                  <Description></Description>
                  <Value></Value>       <!--Custom field -->
               </ValueItem>
            </ValueList>
         </Column>
         <!--Column XML Syntax for ERMV codes -->         <!--IncludeRCMV is set to 1 in the request -->
         <Column>
            <Type></Type>
            <UID></UID>
            <Name></Name>
            <SelectionRequired></SelectionRequired>
            <Warpable></Warpable>            <SelectLeafOnly></SelectLeafOnly><Items>               <Item>                  <ValueUID></ValueUID>                  <Phonetic></Phonetic>                  <Description></Description>                  <Value></Value>               </Item>            </Items>
            <ValueList>
               <ValueItem>
                  <ValueUID></ValueUID>
                  <Phonetic></Phonetic>                  <Description></Description>
                  <Value></Value>
               </ValueItem>
            </ValueList>
         </Column>
      </Columns>
   </ResourceCodeValues>
</Reply>

Remarks

Request and reply elements that are new or changed since Microsoft Project 2002 are shown in bold. The Phonetic element is returned only in the Japanese version of Microsoft Office Project 2003, or if Phonetic has been set by another PDS call in a non-Japanese language.

The PDS checks Project Server security determines whether the logged-on user has valid Project Server permissions. The PDS gathers the values for the enterprise outline codes, and the enterprise custom fields for the requested resource. Graphical custom field values are returned, with the exception of duration and flag custom fields.

If AutoCheckout is set to 1, the PDS ensures that the currently logged-on user has sufficient permission to check out the requested resource, and that the resource is not currently checked out. If permissions are adequate, the PDS marks the resource as checked out by the current user. ResourceCodeValues does not grant access to the resource in the security table (see ResourcesAccess).

ResourceCodeValues is valid for a single resource at a time. Use multiple calls to this method for multiple resources.

The following table shows the possible values of Type in the Column element of the reply.

Value Column Type
-1 ctUnknown
0 ctCode
1 ctText
2 ctNumber
3 ctDate
4 ctWork (not supported)
5 ctFlag (not supported)
6 ctCost
7 ctDuration (not supported)
8 ctMultiValueCode

NoteResourceCodeValues does not return enterprise custom fields for work, flag, or duration.

For custom fields of type cost (Type is 6), the returned Value is shown multiplied by 100; that is the cost assigned to the resource. If ReturnStructures is set to 1 in the request, the reply includes the ValueList of the custom field structure. Value in the value list items shows the actual cost. In the following example, the resource is assigned a cost of 2.00 (200 / 100), from the available value list.

 <Reply>
   . . .
        <Column>
            <Type>6</Type>
            <UID>205521342</UID>
            <Name>EntResourceCost</Name>
            <SelectionRequired>0</SelectionRequired>
            <Value>200</Value>
            <ValueList>
               <ValueItem>
                  <Value>1.00</Value>
               </ValueItem>
               <ValueItem>
                  <Value>2.00</Value>
               </ValueItem>
               <ValueItem>
                  <Value>3.00</Value>
               </ValueItem>
            </ValueList>
         </Column>
   . . .
<Reply>

Conversion values for the custom field UID are listed in Field ID Values for Enterprise Custom Fields. For example, the column UID 205521342 is Resource Enterprise Cost1.