This documentation is archived and is not being maintained.

ProjectAssignmentsCreate Method

Office 2003

Description

The PDS adds one or more assignments to the specified project in Microsoft Office Project Server 2003, and determines the next valid assignment UID. When it creates the assignment, the PDS calculates the Work and Units values based on the standard equation Work = Duration * Units. If you specify neither Work nor Units, then the PDS uses 1.0 for Units, and Work is equal to the task duration. If you specify only Work, then the PDS calculates Units = Work / Duration.

Any existing assignments for the task are ignored, even if specified in the same call. If one assignment creation fails for any reason, then the whole ProjectAssignmentsCreate call fails.

Even though an enterprise resource can be programmatically assigned to a task, that assignment will not affect the resource remaining availability until the project is checked out and checked back in with the Project Professional client.

Syntax

<Request>
   <ProjectAssignmentsCreate>
      <AutoPublish></AutoPublish>
      <ProjectID></ProjectID>
      <ProjectName></ProjectName>
      <Assignments>
         <Assignment>
            <TaskUID></TaskUID>
            <TaskID></TaskID>
            <ResourceUID></ResourceUID>
            <ResourceID></ResourceID>
            <Units></Units>
            <Work></Work>
            -- Other assignment details --
         <Assignment>
      </Assignments>
</ProjectAssignmentsCreate>
</Request>

-- Other supported assignment details --
<PercentWorkComplete></PercentWorkComplete>
<ActualOvertimeWork></ActualOvertimeWork>
<ActualWork></ActualWork>
<CostRateTable></CostRateTable>
<Delay></Delay>
<Finish></Finish>
<OvertimeWork></OvertimeWork>
<RegularWork></RegularWork>
<RemainingOvertimeWork></RemainingOvertimeWork>
<RemainingWork></RemainingWork>
<Start></Start>
<Stop></Stop>

Parameters

AutoPublish

Optional. The default value is 0. If AutoPublish is set to 1, the PDS calls ProjectViewTablesCreate to synchronize the project with the Project Server view tables after all of the assignments have been added. AutoPublish is set for the entire call.

ProjectID or ProjectName

Required. ProjectAssignmentsCreate must include either the ProjectID or the ProjectName. If ProjectID is specified, ProjectName is ignored, even if given. ProjectName is the concatenation of the project name and the version name with a period separator (that is, Name.Version).

TaskUID or TaskID

Required. If TaskUID is specified, TaskID is ignored, even if given.

ResourceUID or ResourceID

Required. If ResourceUID is specified, ResourceID is ignored, even if given.

Units

Optional. Valid values are integer 0 to 100. Units defaults to 100 if not given.

Work

Optional. Work defaults to 0 if not given. If Work is specified, Units are ignored, even if given.

The supported assignment details follow the Project XML Schema.

Note If the project is an Admin project, all work values default to 0. If a non-zero value for any work field is passed in for an Admin project, the PDS returns the STATUS error code 1204.

Return Value

If the requested resource creation is successful, the method returns a successful HRESULT and STATUS.

<Reply>
   <HRESULT>0</HRESULT>
   <STATUS>0</STATUS>
   <UserName>Administrator</UserName>
</Reply>

Remarks

The PDS checks Project Server security for the currently logged-on user and determines whether the user has the necessary permissions and has the requested project checked out. If so, the PDS checks to ensure that the requested TaskUID. TaskID, ResourceUID, and ResourceID parameters are valid for the project.

The PDS adds the project assignments directly in the Project Server database.

 

Show: