Share via


Task.GetField Method

Project Developer Reference

Returns the value in a field. If the selected field is an estimated duration, the returned value will also include the estimated character.

Syntax

expression.GetField(FieldID)

expression   A variable that represents a Task object.

Parameters

Name Required/Optional Data Type Description
FieldID Required Long PjField. Can be one of the following constants:
pjTaskActualCostpjTaskHyperlinkSubAddress
pjTaskActualDurationpjTaskID
pjTaskActualFinishpjTaskIgnoreResourceCalendar
pjTaskActualOvertimeCostpjTaskIndex
pjTaskActualOvertimeWorkpjTaskIndicators
pjTaskActualOvertimeWorkProtectedpjTaskIsAssignment
pjTaskActualStartpjTaskLateFinish
pjTaskActualWorkpjTaskLateStart
pjTaskActualWorkProtectedpjTaskLevelAssignments
pjTaskACWPpjTaskLevelCanSplit
pjTaskAssignmentDelaypjTaskLevelDelay
pjTaskAssignmentUnitspjTaskLinkedFields
pjTaskBaseline1-10CostpjTaskMarked
pjTaskBaseline1-10DurationpjTaskMilestone
pjTaskBaseline1-10DurationEstimatedpjTaskName
pjTaskBaseline1-10FinishpjTaskNotes
pjTaskBaseline1-10StartpjTaskNumber1-20
pjTaskBaseline1-10WorkpjTaskObjects
pjTaskBaselineCostpjTaskOutlineCode1-10
pjTaskBaselineDurationpjTaskOutlineLevel
pjTaskBaselineDurationEstimatedpjTaskOutlineNumber
pjTaskBaselineFinishpjTaskOverallocated
pjTaskBaselineStartpjTaskOvertimeCost
pjTaskBaselineWorkpjTaskOvertimeWork
pjTaskBCWPpjTaskParentTask
pjTaskBCWSpjTaskPercentComplete
pjTaskCalendarpjTaskPercentWorkComplete
pjTaskConfirmedpjTaskPhysicalPercentComplete
pjTaskConstraintDatepjTaskPredecessors
pjTaskConstraintTypepjTaskPreleveledFinish
pjTaskContactpjTaskPreleveledStart
pjTaskCostpjTaskPriority
pjTaskCost1-10pjTaskProject
pjTaskCostRateTablepjTaskRecurring
pjTaskCostVariancepjTaskRegularWork
pjTaskCPIpjTaskRemainingCost
pjTaskCreatedpjTaskRemainingDuration
pjTaskCriticalpjTaskRemainingOvertimeCost
pjTaskCVpjTaskRemainingOvertimeWork
pjTaskCVPercentpjTaskRemainingWork
pjTaskDate1-10pjTaskResourceEnterpriseMultiValueCode20-29
pjTaskDeadlinepjTaskResourceEnterpriseOutlineCode1-29
pjTaskDelaypjTaskResourceEnterpriseRBS
pjTaskDemandedRequestpjTaskResourceGroup
pjTaskDurationpjTaskResourceInitials
pjTaskDuration1-10pjTaskResourceNames
pjTaskDuration1-10EstimatedpjTaskResourcePhonetics
pjTaskDurationVariancepjTaskResourceType
pjTaskEACpjTaskResponsePending
pjTaskEarlyFinishpjTaskResume
pjTaskEarlyStartpjTaskResumeNoEarlierThan
pjTaskEarnedValueMethodpjTaskRollup
pjTaskEffortDrivenpjTaskSheetNotes
pjTaskEnterpriseCost1-10pjTaskSPI
pjTaskEnterpriseDate1-30pjTaskStart
pjTaskEnterpriseDuration1-10pjTaskStart1-10
pjTaskEnterpriseFlag1-20pjTaskStartSlack
pjTaskEnterpriseNumber1-40pjTaskStartVariance
pjTaskEnterpriseOutlineCode1-30pjTaskStatus
pjTaskEnterpriseProjectCost1-10pjTaskStatusIndicator
pjTaskEnterpriseProjectDate1-30pjTaskStop
pjTaskEnterpriseProjectDuration1-10pjTaskSubproject
pjTaskEnterpriseProjectFlag1-20pjTaskSubprojectReadOnly
pjTaskEnterpriseProjectNumber1-40pjTaskSuccessors
pjTaskEnterpriseProjectOutlineCode1-30pjTaskSummary
pjTaskEnterpriseProjectText1-40pjTaskSV
pjTaskEnterpriseText1-40pjTaskSVPercent
pjTaskEstimatedpjTaskTCPI
pjTaskExternalTaskpjTaskTeamStatusPending
pjTaskFinishpjTaskText1-30
pjTaskFinish1-10pjTaskTotalSlack
pjTaskFinishSlackpjTaskType
pjTaskFinishVariancepjTaskUniqueID
pjTaskFixedCostpjTaskUniquePredecessors
pjTaskFixedCostAccrualpjTaskUniqueSuccessors
pjTaskFixedDurationpjTaskUpdateNeeded
pjTaskFlag1-20pjTaskVAC
pjTaskFreeSlackpjTaskWBS
pjTaskGroupBySummarypjTaskWBSPredecessors
pjTaskHideBarpjTaskWBSSuccessors
pjTaskHyperlinkpjTaskWork
pjTaskHyperlinkAddresspjTaskWorkContour
pjTaskHyperlinkHrefpjTaskWorkVariance
pjTaskHyperlinkScreenTip 
pjTaskActualCost pjTaskHyperlinkSubAddress
pjTaskActualDuration pjTaskID
pjTaskActualFinish pjTaskIgnoreResourceCalendar
pjTaskActualOvertimeCost pjTaskIndex
pjTaskActualOvertimeWork pjTaskIndicators
pjTaskActualOvertimeWorkProtected pjTaskIsAssignment
pjTaskActualStart pjTaskLateFinish
pjTaskActualWork pjTaskLateStart
pjTaskActualWorkProtected pjTaskLevelAssignments
pjTaskACWP pjTaskLevelCanSplit
pjTaskAssignmentDelay pjTaskLevelDelay
pjTaskAssignmentUnits pjTaskLinkedFields
pjTaskBaseline1-10Cost pjTaskMarked
pjTaskBaseline1-10Duration pjTaskMilestone
pjTaskBaseline1-10DurationEstimated pjTaskName
pjTaskBaseline1-10Finish pjTaskNotes
pjTaskBaseline1-10Start pjTaskNumber1-20
pjTaskBaseline1-10Work pjTaskObjects
pjTaskBaselineCost pjTaskOutlineCode1-10
pjTaskBaselineDuration pjTaskOutlineLevel
pjTaskBaselineDurationEstimated pjTaskOutlineNumber
pjTaskBaselineFinish pjTaskOverallocated
pjTaskBaselineStart pjTaskOvertimeCost
pjTaskBaselineWork pjTaskOvertimeWork
pjTaskBCWP pjTaskParentTask
pjTaskBCWS pjTaskPercentComplete
pjTaskCalendar pjTaskPercentWorkComplete
pjTaskConfirmed pjTaskPhysicalPercentComplete
pjTaskConstraintDate pjTaskPredecessors
pjTaskConstraintType pjTaskPreleveledFinish
pjTaskContact pjTaskPreleveledStart
pjTaskCost pjTaskPriority
pjTaskCost1-10 pjTaskProject
pjTaskCostRateTable pjTaskRecurring
pjTaskCostVariance pjTaskRegularWork
pjTaskCPI pjTaskRemainingCost
pjTaskCreated pjTaskRemainingDuration
pjTaskCritical pjTaskRemainingOvertimeCost
pjTaskCV pjTaskRemainingOvertimeWork
pjTaskCVPercent pjTaskRemainingWork
pjTaskDate1-10 pjTaskResourceEnterpriseMultiValueCode20-29
pjTaskDeadline pjTaskResourceEnterpriseOutlineCode1-29
pjTaskDelay pjTaskResourceEnterpriseRBS
pjTaskDemandedRequest pjTaskResourceGroup
pjTaskDuration pjTaskResourceInitials
pjTaskDuration1-10 pjTaskResourceNames
pjTaskDuration1-10Estimated pjTaskResourcePhonetics
pjTaskDurationVariance pjTaskResourceType
pjTaskEAC pjTaskResponsePending
pjTaskEarlyFinish pjTaskResume
pjTaskEarlyStart pjTaskResumeNoEarlierThan
pjTaskEarnedValueMethod pjTaskRollup
pjTaskEffortDriven pjTaskSheetNotes
pjTaskEnterpriseCost1-10 pjTaskSPI
pjTaskEnterpriseDate1-30 pjTaskStart
pjTaskEnterpriseDuration1-10 pjTaskStart1-10
pjTaskEnterpriseFlag1-20 pjTaskStartSlack
pjTaskEnterpriseNumber1-40 pjTaskStartVariance
pjTaskEnterpriseOutlineCode1-30 pjTaskStatus
pjTaskEnterpriseProjectCost1-10 pjTaskStatusIndicator
pjTaskEnterpriseProjectDate1-30 pjTaskStop
pjTaskEnterpriseProjectDuration1-10 pjTaskSubproject
pjTaskEnterpriseProjectFlag1-20 pjTaskSubprojectReadOnly
pjTaskEnterpriseProjectNumber1-40 pjTaskSuccessors
pjTaskEnterpriseProjectOutlineCode1-30 pjTaskSummary
pjTaskEnterpriseProjectText1-40 pjTaskSV
pjTaskEnterpriseText1-40 pjTaskSVPercent
pjTaskEstimated pjTaskTCPI
pjTaskExternalTask pjTaskTeamStatusPending
pjTaskFinish pjTaskText1-30
pjTaskFinish1-10 pjTaskTotalSlack
pjTaskFinishSlack pjTaskType
pjTaskFinishVariance pjTaskUniqueID
pjTaskFixedCost pjTaskUniquePredecessors
pjTaskFixedCostAccrual pjTaskUniqueSuccessors
pjTaskFixedDuration pjTaskUpdateNeeded
pjTaskFlag1-20 pjTaskVAC
pjTaskFreeSlack pjTaskWBS
pjTaskGroupBySummary pjTaskWBSPredecessors
pjTaskHideBar pjTaskWBSSuccessors
pjTaskHyperlink pjTaskWork
pjTaskHyperlinkAddress pjTaskWorkContour
pjTaskHyperlinkHref pjTaskWorkVariance
pjTaskHyperlinkScreenTip  

Return Value
String

Example
The following example displays the value of a field specified by the user.

Visual Basic for Applications
  Sub DisplayField()
Dim Temp As String

Temp = InputBox$("Enter the name of the field you want to see:")
Temp = LCase(Temp)

Select Case Temp
    Case "name"
        MsgBox (ActiveCell.Resource.GetField(FieldID:=pjResourceName))
    Case "initials"
        MsgBox (ActiveCell.Resource.GetField(FieldID:=pjResourceInitials))
    Case "standard rate"
        MsgBox (ActiveCell.Resource.<strong class="bterm">GetField</strong>(FieldID:=pjResourceStandardRate))
    Case ""
        End
    Case Else
        MsgBox "You entered an invalid field. Please try again."
        End
End Select

End Sub

See Also