Share via


DraftProject class

inherits members from Project

Represents the draft version of a project that is either new, or a PublishedProject that is checked out for editing.

Syntax

CSOM

class DraftProject 

JSOM

PS.DraftProject

REST Interface

Supported.

PS.DraftProject

http://contoso.sharepoint.com/sites/pwa/api/ProjectServer/Projects('{projectid}')/Draft

Members

✓ - Read Support       ✓ʷ - Write Support

Properties

Name .NET JSOM REST Type Description
[] ✓ʷ Dictionary<string, Object> Gets or sets an item in the draft project.
Assignments DraftAssignmentCollection Gets the collection of assignments for a project.
Calendar ✓ʷ ✓ʷ ✓ʷ Calendar Gets or sets a Project Server calendar.
CurrencyCode ✓ʷ ✓ʷ ✓ʷ String Gets or sets the currency code of the project, as defined in ISO 4217.
CurrencyDigits ✓ʷ ✓ʷ ✓ʷ Integer Gets or sets the number of decimal digits in currency values.
CurrencyPosition ✓ʷ ✓ʷ ✓ʷ CurrencySymbolPosition Gets or sets the placement of the currency symbol in relation to the currency value.
CurrencySymbol ✓ʷ ✓ʷ ✓ʷ String Gets or sets the currency symbol that represents the type of currency that is used in the project.
CurrentDate ✓ʷ ✓ʷ ✓ʷ DateTime Gets or sets the current date for the project.
DaysPerMonth ✓ʷ ✓ʷ ✓ʷ Integer Gets or sets the default number of working days per month.
DefaultEffortDriven ✓ʷ ✓ʷ ✓ʷ Boolean Gets or sets a value that indicates whether the scheduling of new tasks is effort-driven.
DefaultEstimatedDuration ✓ʷ ✓ʷ ✓ʷ Boolean Gets or sets a value that indicates whether new tasks have estimated durations.
DefaultFixedCostAccrual ✓ʷ ✓ʷ ✓ʷ FixedCostAccrual Gets or sets a value that indicates which default fixed cost accrual method to use on new tasks.
DefaultOvertimeRate ✓ʷ ✓ʷ ✓ʷ Double Gets or sets the default overtime rate for local resources.
DefaultStandardRate ✓ʷ ✓ʷ ✓ʷ Double Gets or sets the default standard rate for local resources.
DefaultTaskType ✓ʷ ✓ʷ ✓ʷ TaskType Gets or sets the default type for tasks in the project.
DefaultWorkFormat ✓ʷ ✓ʷ ✓ʷ WorkFormat Gets or sets the default format for work duration.
Description ✓ʷ ✓ʷ ✓ʷ String Gets or sets a project description.
FieldValues Dictionary<string, Object> Gets the collection of custom fields that have values set for the draft project.
FinishDate ✓ʷ ✓ʷ ✓ʷ DateTime Gets or sets the project finish date.
FiscalYearStartMonth ✓ʷ ✓ʷ ✓ʷ Integer Gets or sets the number of the first month in the fiscal year.
IncludeCustomFields DraftProject Gets a DraftProject object that includes custom fields.
Item ✓ʷ Dictionary<string, Object> Gets or sets an item in the draft project.
MinutesPerDay ✓ʷ ✓ʷ ✓ʷ Integer Gets or sets the default number of minutes per day.
MinutesPerWeek ✓ʷ ✓ʷ ✓ʷ Integer Gets or sets the default number of minutes per week.
Name ✓ʷ ✓ʷ ✓ʷ String Gets or sets a project name.
NewTasksAreManual ✓ʷ ✓ʷ ✓ʷ Boolean Gets or sets a value that indicates whether new tasks are manually scheduled.
NumberFiscalYearFromStart ✓ʷ ✓ʷ ✓ʷ Boolean Gets or sets a value that indicates whether to use the project start year for fiscal year numbering.
Owner ✓ʷ ✓ʷ ✓ʷ SPUser Gets or sets the project owner.
ProjectIdentifier ✓ʷ ✓ʷ ✓ʷ String Gets or sets the Project Identifer (secondary identifer)
ProjectResources DraftProjectResourceCollection Gets the collection of resources for a project.
ProtectedActualsSynch ✓ʷ ✓ʷ ✓ʷ Boolean Gets or sets a value that indicates whether the project actuals are synchronized with the protected actuals.
ShowEstimatedDurations ✓ʷ ✓ʷ ✓ʷ Boolean Gets or sets a value that indicates whether a question mark is displayed after an estimated duration for a task.
StartDate ✓ʷ ✓ʷ ✓ʷ DateTime Gets or sets the project start date.
StatusDate ✓ʷ ✓ʷ ✓ʷ DateTime Gets or sets the current status date for the project.
TaskLinks DraftTaskLinkCollection Gets the collection of draft task link objects for the project.
Tasks DraftTaskCollection Gets the collection of task objects for the project.
TrackingMode ✓ʷ ✓ʷ ✓ʷ TrackingMode Gets or sets the default tracking method for all assignments in the project.
UtilizationDate ✓ʷ ✓ʷ ✓ʷ DateTime The start date and time for use of the resource plan.
UtilizationType ✓ʷ ✓ʷ ✓ʷ UtilizationType An enumerated value that represents the utilization type of a resource plan.
WeekStartDay ✓ʷ ✓ʷ ✓ʷ Integer Gets or sets the day of the week on which a work week starts.
WinprojVersion ✓ʷ ✓ʷ ✓ʷ Decimal Gets or sets the version of Project Professional that created the draft project.

Methods

Name .NET JSOM REST Return Type Description
ChangeEnterpriseProjectType(Guid enterpriseProjectTypeUid) void Changes or sets an EnterpriseProjectType associated with a project.
CheckIn(Boolean force) QueueJob Queues a check-in job for a draft project if it is still checked out.
Publish(Boolean checkIn) QueueJob Queues a publish job to get the changes from the draft project back to the published version.
Update() QueueJob Saves changes in a new project or checked-out draft project back to Project Server.
UpdateCustomFields(Collection(SP.KeyValue) customFieldDictionary) QueueJob Updates the custom fields for a project in bulk.
Validate() void Validates pending changes from all added or removed projects.

#### Method Details

ChangeEnterpriseProjectType(Guid enterpriseProjectTypeUid)

Changes or sets an EnterpriseProjectType associated with a project.

Syntax
void ChangeEnterpriseProjectType(Guid enterpriseProjectTypeUid)
Parameters
Name Type Description
enterpriseProjectTypeUid Guid Id of the new EnterpriseProjectType.
Return Value

void

CheckIn(Boolean force)

Queues a check-in job for a draft project if it is still checked out.

Syntax
QueueJob CheckIn(Boolean force)
Parameters
Name Type Description
force Boolean True if the administrator or project owner forces check in of a project; otherwise, False.
Return Value

QueueJob
A queued job that will check in the draft version of the project.

Publish(Boolean checkIn)

Queues a publish job to get the changes from the draft project back to the published version.

Syntax
QueueJob Publish(Boolean checkIn)
Parameters
Name Type Description
checkIn Boolean Boolean that indicates whether the project should be checked in after it is published.
Return Value

QueueJob
A QueueJob object that contains information about the queued job. If the queue job is successful, the Project Server Queuing Service publishes the draft version of the project.

Update()

Saves changes in a new project or checked-out draft project back to Project Server.

Syntax
QueueJob Update()
Parameters

None

Return Value

QueueJob
A QueueJob object that contains information about the queued job. If the queue job is successful, the Project Server Queuing Service saves the new or draft version of the project.

UpdateCustomFields(Collection(SP.KeyValue) customFieldDictionary)

Syntax
QueueJob UpdateCustomFields(Collection(SP.KeyValue) customFieldDictionary)
Parameters
Name Type Description
customFieldDictionary Collection(SP.KeyValue) Collection of project custom fields to set for the project
Return Value

QueueJob
A QueueJob object that contains information about the queued job. If the queue job is successful, the Project Server Queuing Service saves the new or draft version of the project.

Validate()

Validates pending changes from all added or removed projects.

Syntax
void Validate()
Parameters

None

Return Value

void

Remarks

The DraftProject class and the PublishedProject class derive from the Project class.

To set the value of properties in an existing project:

  1. Use the PublishedProject CheckOut method.
  2. Edit the DraftProject object.
  3. Check in the edited project using the DraftProject CheckIn method.

See Also

Collection(SP.KeyValue)
PublishedProject
SPUser