Share via


EntityType: Resource (ProjectData service)

In this article
Definition
Parent element
Child elements

Contains the properties that define the reporting data for a resource in the ProjectData service.

Example

The following REST query uses the Resources entity set and the ResourceId key to get the specified resource and properties. The query is all on one line.

https://<pwa_url>/_api/ProjectData/Resources
    ?$filter=ResourceId eq guid'7589986b-c623-e211-b517-00155d34681f'
    &$select=ResourceBaseCalendar,ResourceIsActive,ResourceName

The following statement uses LINQ query syntax to retrieve Resource entity data from the OData interface of the Project Server reporting tables. To use the statement in an application, set a service reference to the ProjectDataService, and initialize the ReportingData context. The Resources entity set can then be accessed as context.Resources. For more information, see Querying OData feeds for Project 2013 reporting data.

var query =
    from r in Resources
    orderby r.ResourceName
    where (r.ResourceCount > (Int32)0)
    select new
    {
        ResourceName = r.ResourceName,
        ResourceEarliestAvailableFrom = r.ResourceEarliestAvailableFrom,
        ResourceStandardRate = r.ResourceStandardRate,
        ResourceMaxUnits = r.ResourceMaxUnits
    };

The preceding statement can be written by using Lambda expression syntax, as follows:

var query = Resources
    .OrderBy(r => r.ResourceName)
    .Where(r => (r.ResourceCount > (Int32)0))
    .Select(r => new
    {
        ResourceName = r.ResourceName,
        ResourceEarliestAvailableFrom = r.ResourceEarliestAvailableFrom,
        ResourceStandardRate = r.ResourceStandardRate,
        ResourceMaxUnits = r.ResourceMaxUnits
    });

Both preceding statements create the following REST URL (all on one line).

http://<pwa_url>/_api/ProjectData/Resources
    ?$orderby=ResourceName
    &$filter=ResourceCount gt 0
    &$select=ResourceName,ResourceEarliestAvailableFrom,ResourceStandardRate,ResourceMaxUnits

All three of the sample queries get the same data shown in the table below.

Sample results of the Resources query

ResourceName

ResourceEarliestAvailableFrom

ResourceStandardRate

ResourceMaxUnits

Resource1

3/4/2012 8:00:00 AM

$19.00

100%

Resource2

3/2/2012 8:00:00 AM

$18.00

100%

Resource3

3/3/2012 8:00:00 AM

$15.50

100%

Definition

<EntityType Name="Resource">
  <Key>
    <PropertyRef Name="ResourceId" />
  </Key>
  <Property Name="ResourceId" Type="Edm.Guid" Nullable="false" />
  . . .
  <NavigationProperty Name="Assignments" Relationship="ReportingData.Assignment_Resource_Resource_Assignments" ToRole="Assignment_Resource" FromRole="Resource_Assignments" />
  . . .
</EntityType>

Parent element

Element

Description

ReportingData

The schema for the reporting data in the ProjectData service.

Child elements

Child elements are properties of a resource and navigation properties of that resource. Attributes of the Property elements specify the property name and type, and whether the property can be a null value. The NavigationProperty elements specify collections of entities, such as assignments, that are associated with a resource. A navigation property uses an Association element in a query for a related entity collection

The Key element specifies the property that is the primary key for a resource query. ResourceId is the resource GUID.

Property elements

The following table lists the Property elements for the Resource entity. The Name, Type, and Nullable columns contain attribute values for each property.

Attribute values for the Property elements of Resource

Name

Type

Nullable

Description

CostType

Edm.String

true

A type of cost, for instance cumulative cost or cost-per-use.

RBS

Edm.String

true

A custom field that helps to determine the resources and the assignments that a user can view in the Resource Center when they are using Microsoft Project Web Access.

ResourceBaseCalendar

Edm.String

true

The base calendar for a resource.

ResourceBookingType

Edm.Byte

true

The resource booking type, proposed or committed.

ResourceCanLevel

Edm.Boolean

false

True if resource leveling can be done.

ResourceCode

Edm.String

true

A user-defined code for filtering or sorting resources.

ResourceCostCenter

Edm.String

true

A user-defined code for resource cost accounting.

ResourceCostPerUse

Edm.Decimal

false

The cost that accrues each time a work resource is used.

ResourceCreatedDate

Edm.DateTime

false

The date and time that a resource was created in the project.

ResourceDepartments

Edm.String

true

The department that is associated with a resource.

ResourceEarliestAvailableFrom

Edm.DateTime

true

The earliest date that a resource is available for work on a particular task.

ResourceEmailAddress

Edm.String

true

The email address of a resource.

ResourceGroup

Edm.String

true

The group to which a resource belongs.

ResourceHyperlink

Edm.String

true

The URL that is specified for a resource in the Edit User page of Project Web Access.

ResourceHyperlinkHref

Edm.String

true

The text that is displayed for a resource hyperlink, as specified in the Edit User page of Project Web Access.

ResourceId

Edm.Guid

false

Key
The GUID that identifies a resource.

ResourceInitials

Edm.String

true

The initials of a resource.

ResourceIsActive

Edm.Boolean

false

True if a resource is active.

ResourceIsGeneric

Edm.Boolean

false

True if a resource is generic.

ResourceIsTeam

Edm.Boolean

false

True if a resource is a team resource.

ResourceLatestAvailableTo

Edm.DateTime

true

The last date that a resource is available.

ResourceMaterialLabel

Edm.String

true

A unit of measurement for a material resource.

ResourceMaxUnits

Edm.Decimal

false

The maximum capacity (percentage or units) that a resource is available to accomplish tasks during the current time period.

ResourceModifiedDate

Edm.DateTime

false

The date that information about a resource was last modified.

ResourceName

Edm.String

true

The name of a resource.

ResourceNTAccount

Edm.String

true

The Windows account name for a resource.

ResourceOvertimeRate

Edm.Decimal

false

The rate of overtime pay for a resource.

ResourceStandardRate

Edm. Decimal

false

The standard rate of pay for a resource.

ResourceStatusId

Edm.Guid

false

The GUID of a resource status.

ResourceStatusName

Edm.String

true

The localized name of a resource status (for example, Unassigned Resource, Local Resource, Unknown Resource, and Enterprise Resource).

ResourceTimesheetManageId

Edm.Guid

true

The GUID of a timesheet manager.

ResourceType

Edm.Int16

false

The type of a resource (for example, Enterprise, Local, Project Server, Material, or Generic). See ResourceType for valid values.

ResourceWorkGroup

Edm.Int16

true

A number value that represents a team collaboration method for a resource.

TypeDescription

Edm.String

true

The description of the resource type.

TypeName

Edm.String

true

The name of the resource type (for example, Pure User or Work Resource).

The following table lists attribute values for the NavigationProperty elements of the Resource entity. The Name and Relationship columns contain attribute values for each navigation property.

Each Relationship attribute has two pairs of names; each pair of names indicates a navigation direction. The first pair starts with the entity type that has the primary, or starting, role in the navigation. The second pair starts with the entity type that has the secondary, or dependent, role in the navigation. For example, for the Assignments navigation property, the primary type is Assignment, and the secondary type is Resource. For this type of navigation, the FromRole is Assignment_Resource, and the ToRole is Resource_Assignments.

Attribute values for the NavigationProperty elements

Name

Relationship

Description

Assignments

Assignment_Resource_Resource_Assignments

Establishes navigation from a collection of assignments to a resource and from a resource to a collection of assignments.

TimephasedInfoDataSet

ResourceTimephasedData_Resource_Resource_TimephasedInfoDataSet

Establishes navigation from resource timephased data to a resource and from a resource to a timephased information data set.

See also

Reference

Resources

ReportingData

Concepts

Querying OData feeds for Project 2013 reporting data