Project class
inherits members from ClientObject
Contains the common properties for draft projects and published projects.
Syntax
CSOM
class Project
JSOM
PS.Project
REST Interface
Supported.
PS.Project
http://contoso.sharepoint.com/sites/pwa/api/ProjectServer/Projects('projectid')
Members
✓ - Read Support ✓ʷ - Write Support
Properties
Name | .NET | JSOM | REST | Type | Description | |
---|---|---|---|---|---|---|
ApprovedEnd | ✓ | ✓ | ✓ | DateTime | Gets the approved end date in the project portfolio planner. | |
ApprovedStart | ✓ | ✓ | ✓ | DateTime | Gets the approved start date in the project portfolio planner. | |
CalculateActualCosts | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether the project automatically calculates actual and remaining work and costs. | |
CalculatesActualCosts | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether the project always calculates actual costs. | |
CheckedOutBy | ✓ | ✓ | ✓ | SPUser | Gets the user who has the project checked out. | |
CheckedOutDate | ✓ | ✓ | ✓ | DateTime | Gets the date when project was checked out. | |
CheckOutDescription | ✓ | ✓ | ✓ | String | Gets the description of the current checkout action for the project. | |
CheckOutId | ✓ | ✓ | ✓ | Guid | Gets the session GUID that is associated with the current check out. | |
CreatedDate | ✓ | ✓ | ✓ | DateTime | Gets the date when the project was created. | |
CriticalSlackLimit | ✓ | ✓ | ✓ | Integer | Gets the date when the project was created. | |
CustomFields | ✓ | ✓ | ✓ | CustomFieldCollection | Gets the collection of project custom fields that have values set for the project. | |
DefaultFinishTime | ✓ | ✓ | ✓ | DateTime | Gets the default end time of a working day. | |
DefaultOvertimeRateUnits | ✓ | ✓ | ✓ | OvertimeRateFormat | Gets the time unit for the default overtime rate. | |
DefaultStandardRateUnits | ✓ | ✓ | ✓ | StandardRateFormat | Gets the time unit for the default standard rate. | |
DefaultStartTime | ✓ | ✓ | ✓ | DateTime | Gets the default start time of a working day. | |
Engagements | ✓ | ✓ | ✓ | ProjectEngagementCollection | Returns the engagements for this project. | |
EnterpriseProjectType | ✓ | ✓ | ✓ | EnterpriseProjectType | Gets the enterprise project type (EPT) for the project. | |
HasMppPendingImport | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether there is an mpp file waiting to be imported. | |
HonorConstraints | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether scheduling constraints take precedence over dependencies. | |
Id | ✓ | ✓ | ✓ | Guid | Gets the GUID of the project. | |
IsCheckedOut | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether the project is checked out. | |
LastPublishedDate | ✓ | ✓ | ✓ | DateTime | Gets the most recent date when the project was published. | |
LastSavedDate | ✓ | ✓ | ✓ | DateTime | Gets the most recent date when the project was saved. | |
ListId | ✓ʷ | Guid | List Id on the web that the project was created from. | |||
MoveActualIfLater | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether to move the end date of completed parts forward to the status date, if the actual end date falls before the status date. | |
MoveActualToStatus | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether to move the end date of completed parts back to the status date, if the actual end data falls after the status date. | |
MoveRemainingIfEarlier | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether to move the start date of remaining parts forward to the status date, if the actual start date falls before the status date. | |
MoveRemainingToStatus | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether to move the start date of the remaining parts back to the status date, if the actual start date falls after the status date. | |
MultipleCriticalPaths | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether to calculate multiple critical paths. | |
OptimizerDecision | ✓ | ✓ | ✓ | CommittedDecisionResult | Gets the result of the Optimizer in a project portfolio analysis. | |
PercentComplete | ✓ | ✓ | ✓ | Integer | Gets the percentage complete of the project summary task. | |
Phase | ✓ | ✓ | ✓ | Phase | Gets the current workflow phase of the project. | |
PlannerDecision | ✓ | ✓ | ✓ | CommittedDecisionResult | Gets the result of the Planner in a project portfolio analysis. | |
ProjectSiteUrl | ✓ | ✓ | ✓ | String | Gets the URL of the project site. | |
ProjectSummaryTask | ✓ | ✓ | ✓ | ProjectSummaryTask | Gets the summary task that represents the entire project. | |
ProjectType | ✓ | ✓ | ✓ | ProjectType | Gets the type of project (standard project, template, master project, or subproject). | |
QueueJobs | ✓ | ✓ | ✓ | QueueJobCollection | Gets the collection of Project Server Queue Service jobs that are associated with the project. | |
ScheduledFromStart | ✓ | ✓ | ✓ | Boolean | Gets whether the project is scheduled from the finish date instead of the start date. | |
SplitInProgress | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether to split tasks that are in progress. | |
SpreadActualCostsToStatus | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether actual costs are spread to the status date or to the stop date. | |
SpreadPercentCompleteToStatus | ✓ | ✓ | ✓ | Boolean | Gets a value that indicates whether the percentage complete consideration period is spread to the status date or to the task finish date. | |
Stage | ✓ | ✓ | ✓ | Stage | Gets the current workflow stage of the project. | |
SummaryTaskId | ✓ | ✓ | ✓ | Guid | Gets the GUID for the hidden project summary task. | |
TaskListId | ✓ | ✓ | ✓ | Guid | Gets the GUID of the project's task list. | |
WebId | ✓ʷ | Guid | The Id of the web that contains the list where the project was created from. (Ideation Scenario) |
Methods
Name | .NET | JSOM | REST | Return Type | Description |
---|---|---|---|---|---|
EnterProjectStage(Stage stage) | ✓ | ✓ | ✓ | void | Switches the project to the specified stage in a Project Server workflow. |
GetResourcePlan(DateTime start, DateTime end, TimeScale timeScale) | ✓ | ✓ | ResourcePlan | Gets resource plan data for a project by filtering project data with date range and timescale parameters. | |
GetResourcePlanByUrl(String start, String end, String scale) | ✓ | ResourcePlan | Gets resource plan data for a project by filtering project data with date range and timescale parameters. | ||
LeaveProjectStage() | ✓ | ✓ | ✓ | void | Sets the project complete and leaves the current workflow stage. |
ReadyToLeaveProjectStage() | ✓ | ✓ | ✓ | ReadyToLeaveProjectStageValue | Checks whether the current workflow stage requirements are met and the project is ready to move to the next stage. |
SetCustomFieldValue(String fieldName, Object value) | ✓ | ✓ | void | Sets a custom field on the project. | |
UpdateIdeaListItemStatus(String status) | ✓ | ✓ | ✓ | void | Updates the Project Server Status column in the idea list with a status message. |
UpdateProjectStageStatus(Stage stage, String statusInformation, UpdateProjectStageStatusFieldValue stageStatusValue, Boolean append) | ✓ | ✓ | ✓ | void | Updates the status of a workflow stage for the project. |
#### Method Details
EnterProjectStage(Stage stage)
Switches the project to the specified stage in a Project Server workflow.
Syntax
void EnterProjectStage(Stage stage)
Parameters
Name | Type | Description |
---|---|---|
stage | Stage | The workflow stage. |
Return Value
void
GetResourcePlan(DateTime start, DateTime end, TimeScale timeScale)
Gets resource plan data for a project by filtering project data with date range and timescale parameters.
Syntax
ResourcePlan GetResourcePlan(DateTime start, DateTime end, TimeScale timeScale)
Parameters
Name | Type | Description |
---|---|---|
start | DateTime | The start date for the resource plan data. |
end | DateTime | The end date for the resource plan data. |
timeScale | TimeScale | An enumeration that represents a time scale (for example, days or weeks). |
Return Value
GetResourcePlanByUrl(String start, String end, String scale)
Gets resource plan data for a project by filtering project data with date range and timescale parameters.
Syntax
ResourcePlan GetResourcePlanByUrl(String start, String end, String scale)
Parameters
Name | Type | Description |
---|---|---|
start | String | The start date for the resource plan data. |
end | String | The end date for the resource plan data. |
scale | String | An enumeration that represents a time scale (for example, days or weeks). See TimeScale |
Return Value
ResourcePlan
A resource plan.
Remarks
A resource plan provides a way to estimate corporate resource capacity when some projects are in full execution and others are still in the proposal phase or planning phase.
LeaveProjectStage()
Sets the project complete and leaves the current workflow stage.
Syntax
void LeaveProjectStage()
Parameters
None
Return Value
void
ReadyToLeaveProjectStage()
Checks whether the current workflow stage requirements are met and the project is ready to move to the next stage.
Syntax
ReadyToLeaveProjectStageValue ReadyToLeaveProjectStage()
Parameters
None
Return Value
ReadyToLeaveProjectStageValue
A collection of enumeration constants that describe which of the requirements are not met.
SetCustomFieldValue(String fieldName, Object value)
Sets a custom field on the project.
Syntax
void SetCustomFieldValue(String fieldName, Object value)
Parameters
Name | Type | Description |
---|---|---|
fieldName | String | The InternalName of the custom field to update. |
value | Object | New value of the custom field. |
Return Value
void
UpdateIdeaListItemStatus(String status)
Updates the Project Server Status column in the idea list with a status message.
Syntax
void UpdateIdeaListItemStatus(String status)
Parameters
Name | Type | Description |
---|---|---|
status | String | The project status message. |
Return Value
void
UpdateProjectStageStatus(Stage stage, String statusInformation, UpdateProjectStageStatusFieldValue stageStatusValue, Boolean append)
Updates the status of a workflow stage for the project.
Syntax
void UpdateProjectStageStatus(Stage stage, String statusInformation, UpdateProjectStageStatusFieldValue stageStatusValue, Boolean append)
Parameters
Name | Type | Description |
---|---|---|
stage | Stage | The workflow stage to be updated. |
statusInformation | String | The status message. |
stageStatusValue | UpdateProjectStageStatusFieldValue | An enumeration constant that indicates the stage status. |
append | Boolean | True if the status message is appended to the current stage status;False if the status message overwrites the current status. |
Return Value
void
Remarks
The DraftProject class class and the PublishedProject class class derive from the Project class.
To set the value of properties in an existing project:
- Use the PublishedProject CheckOut method.
- Edit the DraftProject object.
- Check in the edited project using the DraftProject CheckIn method.
See Also
DraftProject
Engagement
ProjectEngagement
PublishedProject
QueueJob
SPUser