This documentation is archived and is not being maintained.

ProjectAssignmentsCreate Method

Office 2003


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.


            -- Other assignment details --

-- Other supported assignment details --



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.


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


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.



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.