ResourcesAdd Method

Description

The ResourcesAdd method adds one or more resources to the Enterprise Resource Pool in Microsoft Office Project Server 2003.

Syntax

<Request>
   <ResourcesAdd>
      <Resources>
         <Resource>
            <Name></Name>
            -- Other resource details --
         </Resource>
      </Resources>
   </ResourcesAdd>
</Request>

-- Other resource details --
<Phonetics></Phonetics>
<NTAccount></NTAccount>
<EmailAddress></EmailAddress>
<Type></Type>
<IsGeneric></IsGeneric>
<Initials></Initials>
<Code></Code>
<Group></Group>
<WorkGroup></WorkGroup>
<MaxUnits></MaxUnits>
<CanLevel></CanLevel>
<AccrueAt></AccrueAt>
<StandardRate></StandardRate>
<StandardRateFormat></StandardRateFormat>
<OvertimeRate></OvertimeRate>
<OvertimeRateFormat></OvertimeRateFormat>
<CostPerUse></CostPerUse>
<ADGUID></ADGUID>

Parameters

Name

Required. The resource name is checked to determine whether characters and formatting are valid, and whether it is unique in Project Server and the Enterprise Resource Pool.

Other details of the resource are optional. The list of supported resource details above follows the Microsoft Project XML Schema.

Phonetics

Optional. Phonetics contains phonetic information in either Hiragana or Katakana for resource names; it is used only in the Japanese version of Microsoft Office Project 2003.

Type

Optional. For a Material resource (Type is 0), MaxUnits will be ignored, even if provided, for consistency with the Project client behavior.

Type Description
0 Material resource
1 Work resource (default)

AccrueAt

Optional. Indicates how and when resource standard and overtime costs are to be charged, or accrued, to the cost of a task.

AccrueAt Description
1 Start
2 End
3 Prorated (default)

StandardRateFormat* and *OvertimeRateFormat

Optional. The units used to display the standard and overtime rates.

RateFormat Description
1 Minute
2 Hour (default)
3 Day
4 Week
5 Month
7 Year

Workgroup

Optional. Specifies the messaging method used to communicate with that resource.

Note The PDS does not currently accept Workgroup values of 2 or 4 (messaging by e-mail, or by both e-mail and the Web).

Workgroup Description
0 Uses the collaboration setting for the workgroup team (default).
1 None. Workgroup messaging is not used on this project.
3 Messaging is by the Web (Project Web Access).

Other resource details are optional.

Return Value

If all requested resource additions are successful, ResourcesAdd returns a successful HRESULT and STATUS with the name and Enterprise Unique ID (EUID) for each resource. However, if for any reason one of the requested resource creations fails, they all fail, and the PDS immediately returns and includes an error code for the first resource that failed.

<Reply>
   <HRESULT>0</HRESULT>
   <STATUS>0</STATUS>
   <UserName>Administrator</UserName>
   <Resources>
      <Resource>
         <ResourceName></ResourceName>
         <ResourceUID></ResourceUID>
         <ReplyStatus></ReplyStatus>
      </Resource>
   </Resources>
</Reply>

Remarks

The PDS checks Project Server security for the currently logged-on user and determines if the user is a valid Project Server user and whether the user has the “Add new resource” permission. The PDS also checks to ensure that the Enterprise Resource Pool is checked out to the current user.

The PDS adds the resource directly into the Project Server database and handles synchronization of the resources in Project Server, so it is not necessary to call ResourcesNew after calling ResourcesAdd.

If the resource Type is 0 (material resource), EmailAddress and MaxUnits are ignored.

If the request includes NTAccount, and IsGeneric is set to 1, ResourcesAdd fails with an error code since a resource with a Windows logon account cannot be created as a generic resource.

Note   ResourcesAdd does not enforce any required resource fields.