ProjectResourcesDelete Method

Description

The PDS removes enterprise or local resources from a specified project in Microsoft Office Project Server 2003. To remove a resource from a project, the user must first check out the project from Project Server. ProjectResourcesDelete has no effect on the Enterprise Resource Pool.

The PDS first determines whether the user permissions are valid on Project Server and whether the user has checked out the requested project. The PDS then checks that each resource exists in the project. ProjectResourcesDelete fails if any of the specified resources have reported actual work in the project plan (in the database Project tables), or has pending actual work (in the database Web tables).

Syntax

<Request>
   <ProjectResourcesDelete>
      <AutoPublish></AutoPublish>
      <ProjectID></ProjectID>
      <ProjectName></ProjectName>
      <Resources>
         <Resource>
            <Name></Name>
            <EUID></EUID>
         <Resource>
      </Resources>
   </ProjectResourcesDelete>
</Request>

Parameters

AutoPublish

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

ProjectID* or *ProjectName

Required. ProjectResourcesDelete 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).

Name* or *EUID

Required. Either the resource name or the Enterprise Unique ID is required for at least one resource. If EUID is specified, Name is ignored, even if given.

Return Value

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

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

Remarks

If there is more than one local resource with the same name, ProjectResourcesDelete will delete only the first instance the PDS finds of the local resource. If the user needs to delete all of the local resources with the same name, multiple calls to ProjectResourcesDelete are required (one call per resource with the same name).

If a resource has assignments in the project, those assignments will be lost when the resource is removed.