TaskKey

TaskKey enumeration

Represents a list of supported task fields.

public enum TaskKey

Values

Name Value Description
Uid 0 Represents the Unique ID (Task) field.
Id 1 Represents the Id (Task) field.
Name 2 Represents the Name (Task) field.
Type 3 Represents the Type (Task) field.
IsNull 4 Represents the IsNull (Task) field.
Created 5 Represents the Created (Task) field.
Contact 6 Represents the Contact (Task) field.
WBS 7 Represents the WBS (Task) field.
WBSLevel 8 Represents the WBSLevel (Task) field.
OutlineNumber 9 Represents the OutlineNumber (Task) field.
OutlineLevel 10 Represents the OutlineLevel (Task) field.
Priority 11 Represents the Priority (Task) field.
Start 12 Represents the Start (Task) field.
Finish 13 Represents the Finish (Task) field.
Duration 14 Represents the Duration (Task) field.
DurationVariance 15 Represents the DurationVariance (Task) field.
DurationFormat 16 Represents the DurationFormat (Task) field.
Work 17 Represents the Work (Task) field.
Stop 18 Represents the Stop (Task) field.
Resume 19 Represents the Resume (Task) field.
IsResumeValid 20 Represents the IsResumeValid (Task) field.
IsEffortDriven 21 Represents the IsEffortDriven (Task) field.
IsRecurring 22 Represents the IsRecurring (Task) field.
IsOverallocated 23 Represents the IsOverallocated (Task) field.
HasOverallocatedResource 24 Represents the HasOverallocatedResource (Task) field.
IsEstimated 25 Represents the IsEstimated (Task) field.
IsMilestone 26 Represents the IsMilestone (Task) field.
IsCritical 27 Represents the IsCritical (Task) field.
IsSubproject 28 Represents the IsSubproject (Task) field.
IsSubprojectReadOnly 29 Represents the IsSubprojectReadOnly (Task) field.
IsMarked 30 Represents the IsMarked (Task) field.
IgnoreWarnings 31 Represents the IgnoreWarnings (Task) field.
SubprojectName 32 Represents the SubprojectName (Task) field.
IsExternalTask 33 Represents the IsExternalTask (Task) field.
IsSummary 34 Represents the IsSummary (Task) field.
ExternalTaskProject 35 Represents the ExternalTaskProject (Task) field.
ExternalId 36 Represents the ExternalId (Task) field.
ExternalKey 37 Represents the ExternalKey (Task) field.
EarlyStart 38 Represents the EarlyStart (Task) field.
EarlyFinish 39 Represents the EarlyFinish (Task) field.
LateStart 40 Represents the LateStart (Task) field.
LateFinish 41 Represents the LateFinish (Task) field.
StartVariance 42 Represents the StartVariance (Task) field.
FinishVariance 43 Represents the FinishVariance (Task) field.
WorkVariance 44 Represents the WorkVariance (Task) field.
CostVariance 45 Represents the CostVariance (Task) field.
FreeSlack 46 Represents the FreeSlack (Task) field.
TotalSlack 47 Represents the TotalSlack (Task) field.
StartSlack 48 Represents the StartSlack (Task) field.
FinishSlack 49 Represents the FinishSlack (Task) field.
FixedCost 50 Represents the FixedCost (Task) field.
FixedCostAccrual 51 Represents the FixedCostAccrual (Task) field.
PercentComplete 52 Represents the PercentComplete (Task) field.
PercentWorkComplete 53 Represents the PercentWorkComplete (Task) field.
Cost 54 Represents the Cost (Task) field.
OvertimeCost 55 Represents the OvertimeCost (Task) field.
ActualStart 56 Represents the ActualStart (Task) field.
ActualFinish 57 Represents the ActualFinish (Task) field.
ActualDuration 58 Represents the ActualDuration (Task) field.
ActualCost 59 Represents the ActualCost (Task) field.
ActualOvertimeCost 60 Represents the ActualOvertimeCost (Task) field.
ActualWork 61 Represents the ActualWork (Task) field.
ActualOvertimeWork 62 Represents the ActualOvertimeWork (Task) field.
OvertimeWork 63 Represents the OvertimeWork (Task) field.
RegularWork 64 Represents the RegularWork (Task) field.
RemainingDuration 65 Represents the RemainingDuration (Task) field.
RemainingCost 66 Represents the RemainingCost (Task) field.
RemainingWork 67 Represents the RemainingWork (Task) field.
RemainingOvertimeWork 68 Represents the RemainingOvertimeWork (Task) field.
RemainingOvertimeCost 69 Represents the RemainingOvertimeCost (Task) field.
ACWP 70 Represents the ACWP (Task) field.
CV 71 Represents the CV (Task) field.
SV 72 Represents the SV (Task) field.
ConstraintType 73 Represents the ConstraintType (Task) field.
Calendar 74 Represents the Calendar (Task) field.
ConstraintDate 75 Represents the ConstraintDate (Task) field.
Deadline 76 Represents the Deadline (Task) field.
LevelAssignments 77 Represents the LevelAssignments (Task) field.
LevelingCanSplit 78 Represents the LevelingCanSplit (Task) field.
LevelingDelay 79 Represents the LevelingDelay (Task) field.
LevelingDelayFormat 80 Represents the LevelingDelayFormat (Task) field.
PreleveledStart 81 Represents the PreleveledStart (Task) field.
PreleveledFinish 82 Represents the PreleveledFinish (Task) field.
Hyperlink 83 Represents the Hyperlink (Task) field.
HyperlinkAddress 84 Represents the HyperlinkAddress (Task) field.
HyperlinkSubAddress 85 Represents the HyperlinkSubAddress (Task) field.
IgnoreResourceCalendar 86 Represents the IgnoreResourceCalendar (Task) field.
HideBar 87 Represents the HideBar (Task) field.
IsRollup 88 Represents the IsRollup (Task) field.
BCWS 89 Represents the BCWS (Task) field.
BCWP 90 Represents the BCWP (Task) field.
PhysicalPercentComplete 91 Represents the PhysicalPercentComplete (Task) field.
EarnedValueMethod 92 Represents the EarnedValueMethod (Task) field.
ActualWorkProtected 93 Represents the ActualWorkProtected (Task) field.
ActualOvertimeWorkProtected 94 Represents the ActualOvertimeWorkProtected (Task) field.
IsPublished 95 Represents the IsPublished (Task) field.
IsScheduled 96 Represents the IsScheduled (Task) field.
StatusManager 97 Represents the StatusManager (Task) field.
CommitmentStart 98 Represents the CommitmentStart (Task) field.
CommitmentFinish 99 Represents the CommitmentFinish (Task) field.
CommitmentType 100 Represents the CommitmentType (Task) field.
IsManual 101 Represents the IsManual (Task) field.
IsExpanded 102 Represents the IsExpanded (Task) field.
Guid 103 Represents the Guid (Task) field.
NotesText 104 Represents the NotesText (Task) field.
NotesRTF 105 Represents the NotesRTF (Task) field.
ManualStart 106 Represents the ManualStart (Task) field.
ManualFinish 107 Represents the ManualFinish (Task) field.
ManualDuration 108 Represents the ManualDuration (Task) field.
BudgetWork 109 Represents the BudgetWork (Task) field.
BudgetCost 110 Represents the BudgetCost (Task) field.
DisplayAsSummary 111 Represents the DisplayAsSummary (Task) field.
SummaryProgress 112 Represents the Summary Progress (Task) field.
IsActive 113 Represents the IsActive (Task) field.
StartText 114 Represents the StartText (Task) field.
FinishText 115 Represents the FinishText (Task) field.
DurationText 116 Represents the DurationText (Task) field.
CalendarUid 117 Represents the CalendarUid (Task) field.
ParentTaskUid 118 Represents the ParentTaskUid (Task) field.
DisplayOnTimeline 119 Represents the DisplayOnTimeline (Task) field.
TaskIsAssigned 120 Represents the TaskIsAssigned (Task) field.
TaskOriginalStart 121 Represents the original start (Task) field.
TaskOriginalFinish 122 Represents the original finish (Task) field.
IsShowBeforeProjectStartDateWarning 123 Represents the flag which makes MSP show the warning that a task is starting before project start date.
Warning 124 Represents the flag which indicates that task has schedule discrepancies.
ParentTaskGuid 125 Represents the ParentTaskGuid (Task) field.
ActivityId 126 Represents the ActivityId field (only applicable to Primavera projects).
FreeSlackTimeSpan 127 Represents the FreeSlack (Task) field.
TotalSlackTimeSpan 128 Represents the TotalSlack (Task) field.
StartSlackTimeSpan 129 Represents the StartSlack (Task) field.
FinishSlackTimeSpan 130 Represents the FinishSlack (Task) field.
ExternalUid 131 Represents the Unique Id of external task.

Examples

Shows how to read/write task properties.

var project = new Project();

// Add task and set task properties
var task = project.RootTask.Children.Add();
task.Set(Tsk.Name, "Task1");
task.Set(Tsk.Start, new DateTime(2020, 3, 31, 8, 0, 0));
task.Set(Tsk.Finish, new DateTime(2020, 3, 31, 17, 0, 0));

var collector = new ChildTasksCollector();
TaskUtils.Apply(project.RootTask, collector, 0);

// Parse through all the collected tasks
foreach (var tsk in collector.Tasks)
{
    Console.WriteLine("Task Id: {0}", tsk.Get(Tsk.Id));
    Console.WriteLine("Task Uid: {0}", tsk.Get(Tsk.Uid));
    Console.WriteLine("Task Name: {0}", tsk.Get(Tsk.Name));
    Console.WriteLine("Task Start: {0}", tsk.Get(Tsk.Start));
    Console.WriteLine("Task Finish: {0}", tsk.Get(Tsk.Finish));
}

See Also