AssignmentsProjectManagerUpdate Method

Description

Microsoft Office Project Server 2003 sends the project manager updates for the specified assignments. The project manager update includes an assignment if the assigned resource has recorded a timesheet change for that assignment.

Permissions

If the assignment is the user’s own, or an assignment of a resource for which the user has Adjust Actuals permission, the PDS sends the update to Project Server if the user has the permission Integrate With External Timesheet Systems.

Syntax

<Request>
    <AssignmentsProjectManagerUpdate>
        <AllResources></AllResources>
        <Resources>
            <Resource>
                <ResourceUID></ResourceUID>
                <ResourceName></ResourceName>
            </Resource>
                . . .
        </Resources>
        <AllAssignments></AllAssignments>
        <WUIDs>
            <WUID></WUID>
                . . .
        </WUIDs>
        <PeriodDateRange>
            <PeriodStartDate></PeriodStartDate>
            <PeriodEndDate></PeriodEndDate>
        </PeriodDateRange>
        <AdminProject></AdminProject>
        <ApprovalStatus></ApprovalStatus>
        <LockedDownByManager></LockedDownByManager>
    </AssignmentsProjectManagerUpdate>
</Request>

Parameters

All parameters to AssignmentsProjectManagerUpdate are optional. If no parameters are specified, the method updates the project manager for all assignments that belong to the currently logged-on user (within the server’s date range). This method takes any assignment updates for the logged-on user and makes them available to the manager in the Updates page.

AllResources

Optional. Boolean specifying whether to update the project manager for all resources to which the currently logged-on user has access. User access is via the object-level Project Server permission View Resource Assignments. Default is 0.

Resources (ResourceName* or *ResourceUID)

Optional. Each <Resource> block represents a specific resource for which assignments are to be returned (assuming the currently logged-on user has sufficient permissions). A resource can be specified by either ResourceUID or ResourceName, both of which are guaranteed to be unique in Project Server. If ResourceUID is set, ResourceName is ignored, even if set.

AllAssignments

Optional. Boolean specifying whether to update the project manager of ALL assignment edits for the currently logged-on user. Default is 0.

WUID

Optional. Long representing the Web unique ID of the edited assignment for updating (from the Web assignments table).

PeriodDateRange: PeriodStartDate* and *PeriodEndDate

Optional. Strings containing the earliest and latest dates in the range in which the project manager is to be updated. Default: If PeriodDateRange is not set, the PDS uses the date range in Project Server.

The date format can be entered as YYYYMMDD or YYYYMMDDHHMMSS. If the hours, minutes, and seconds are included, they must be set to the exact day, for example 20031021000000. The PDS rounds the year up or down to ensure that the date falls within the range 1984 to 2049, inclusive.

For a task with start Ts and finish Tf, and a date range starting at S and running to F, the PDS updates the project manager of edited assignments that satisfy any of the following conditions:

  • Ts is >= S AND <= F [assignment start date falls within the date range]

  • Tf is >= S AND <= F [assignment finish date falls within the date range]

  • Ts is <= S AND Tf >= F [assignment “surrounds” the date range]

Essentially, the PDS updates the project manager of an edited assignment if any portion falls within the date range (including the outer limits of the range).

If PeriodDateRange is incorrectly set (incorrect or missing PeriodStartDate or PeriodEndDate), the PDS returns an error.

AdminProject

Optional. Integer specifying whether the user would like to update the project manager of edits made to assignments from projects of type regular, admin (non-working time), or both. Default is 2 (both types). Valid AdminProject values are as follows:

Type Description
0 Regular projects only
1 Admin (NWT) projects only
2 Both regular and admin projects (default)

ApprovalStatus

Optional. Integer specifying the resource manager approval state of the assignments for which the project manager should be notified of edits.

Note   ApprovalStatus is the resource manager approval, NOT the project manager approval. The database table MSP_WEB_WORK_APPROVAL is for resource manager approval. Project manager approval data is stored in MSP_WEB_TRANSACTIONS.

Only edits made to assignments having at least 1 timephased data segment of the specified approval status will merit a project manager notification. Default is 3 (all assignments).

ApprovalStatus Description
0 Resource Manager approval is pending.
1 Approved by the resource manager.
2 Rejected by the resource manager.
3 All. The project manager is notified of edits made to all assignments, regardless of resource manager approval status (default).

LockedDownByManager

Optional. Boolean specifying whether or not to notify the project manager of changes in closed assignments. Default is 0. For more information, see Changes for Service Pack 1 (SP1) in the topic About Timesheet Methods.

Parameter Priorities

In all cases, assignments included in the project manager update are only those for which the currently logged-on user has access permission. The priority of request parameters is as follows:

  1. If Resources is set (one or more resources specified), AllResources, WUIDs, and AllAssignments are ignored. The project manager is updated of all edited assignments falling within the specified date range (if set; if not, the Project Server date range is used) for the resources specified, from the projects of type specified by AdminProject, and with the approval status specified by ApprovalStatus. The PDS checks that the currently logged-on user has sufficient permissions. The defaults are used if those parameters are not set.

  2. If AllResources is set (and Resources NOT set), WUIDs and AllAssignments are ignored. The project manager is updated of all edited assignments falling within the specified date range, for all the resources to which the currently logged-on user has permissions, from the projects of type specified by AdminProject, and with at least one timephased data segment of the approval status specified by ApprovalStatus.

  3. If WUIDs is set (one or more assignments specified), and Resources and AllResources are NOT set, the PDS ignores AllAssignments and PeriodDateRange. The project manager is updated for all edited assignments, of those specified. AdminProject and ApprovalStatus are ignored if specified.

  4. If AllAssignments is set (and Resources, AllResources and WUIDs are NOT set), PeriodDateRange is ignored. The project manager is updated of all edited assignments for the currently logged-on user, falling within the server’s date range, from both regular and admin projects of any approval status.

  5. If only PeriodDateRange is set, the project manager is updated of all edited assignments for the currently logged-on user, falling within the specified date range, from both regular and admin projects of any approval status.

Return Value

If the request is successful, AssignmentsProjectManagerUpdate returns a successful HRESULT and STATUS and a specific ReplyStatus for each FAILED project manager update. A project manager update is successful if that assignment WUID is not in the reply.

Note   AssignmentsProjectManagerUpdate is different from most PDS methods in this respect: One failure does not invalidate the entire call. Each assignment update is its own transaction; that is, it passes or fails independently of other assignment updates.

Status Codes

Status codes are consistent with ResourcesStatus.

The global status <STATUS> tag is always rsSuccess (that is, 0). AssignmentsProjectManagerUpdate can return one of the following status codes for a specific assignment, if updating the project manager for that assignment WUID fails:

ReplyStatusEnum value Description
rsSecurityAccessDenied = 50 Access errors.
rsAssignmentNotFound = 120 Assignment with specified WUID does not exist (bad WUID specified in request).
rsAssignmentDeleted = 121 Assignment with specified WUID has been deleted from the server.
rsAssignmentUpdateNotNeeded = 124 Assignment with specified WUID does not require project manager update.
<Reply>
    <HRESULT></HRESULT>
    <STATUS></STATUS>
    <UserName></UserName>
    <AssignmentsProjectManagerUpdate>
        <PeriodDateRange>
            <PeriodStartDate></PeriodStartDate>
            <PeriodEndDate></PeriodEndDate>
        </PeriodDateRange>
        <Assignments>
            <Assignment>
                <WUID></WUID>
                <ReplyStatus></ReplyStatus>
            </Assignment>
                . . .
        </Assignments>
    </AssignmentsProjectManagerUpdate>
</Reply>

Remarks

The PDS determines whether the user has a valid Project Server account. The PDS also checks that the user has permission to read each assignment specified by a WUID.

If the database field WASSN_UPDATE_STATUS is 1 (“Edited by resource”), the PDS sends an update to the project manager and sets WASSN_SEND_UPDATE_DATE to the current date.