ProjectDataSet.TaskDataTable.AddTaskRow method
Adds a TaskRow object to the TaskDataTable.
Namespace: WebSvcStatusing
Assembly: ProjectServerServices (in ProjectServerServices.dll)
Syntax
'Declaration
Public Sub AddTaskRow ( _
row As ProjectDataSet.TaskRow _
)
'Usage
Dim instance As ProjectDataSet.TaskDataTable
Dim row As ProjectDataSet.TaskRow
instance.AddTaskRow(row)
public void AddTaskRow(
ProjectDataSet.TaskRow row
)
Parameters
row
Type: WebSvcStatusing.ProjectDataSet.TaskRowThe TaskRow to add to TaskDataTable.
Remarks
To add a task that has a task predecessor, specify the AddPosition property. If AddPosition is a null reference (Nothing in Visual Basic), the task is added at the end of the project.
Important
Project Server does not allow duplicate task GUIDs in the same project, but does not check for duplicate task GUIDs in other projects. You should never reuse a GUID for the TASK_UID when you create tasks, even if the tasks are in different projects. Duplicate task GUIDs break other Project Server functions such as the Cube Build Service and updates of the Reporting database.
The AddTaskRow method signature is overloaded as follows:
Third-party developers should use the overload that has a single ProjectDataSet.TaskRow parameter; for example, AddTaskRow(ProjectDataSet.TaskRow row).
The Object Explorer in Microsoft Visual Studio shows another overload, which uses individual parameters for all fields in TaskRow.
public TaskRow AddTaskRow(
Guid PROJ_UID, Guid TASK_UID, Guid TASK_PARENT_UID,
string TASK_NAME, int TASK_ID, bool TASK_IS_MILESTONE,
bool TASK_IS_SUMMARY, bool TASK_IS_MARKED, bool TASK_IGNORES_RES_CAL,
bool TASK_IS_EFFORT_DRIVEN, bool TASK_IS_CRITICAL, bool TASK_IS_EXTERNAL,
bool TASK_IS_FROM_FINISH_SUBPROJ, bool TASK_IS_OVERALLOCATED,
bool TASK_IS_RECURRING, bool TASK_IS_RECURRING_SUMMARY,
bool TASK_IS_SUBPROJ, bool TASK_IS_READONLY_SUBPROJ,
bool TASK_LOCKDOWN_BY_MANAGER, int TASK_LEVELING_DELAY,
short TASK_LEVELING_DELAY_FMT, bool TASK_LEVELING_CAN_SPLIT,
bool TASK_LEVELING_ADJUSTS_ASSN, bool TASK_DUR_IS_EST,
int TASK_DUR, int TASK_DUR_FMT, int TASK_DUR_VAR,
double TASK_EAC, double TASK_VAC, int TASK_ACT_DUR,
int TASK_REM_DUR, short TASK_CONSTRAINT_TYPE,
DateTime TASK_CONSTRAINT_DATE, DateTime TASK_ACT_START,
DateTime TASK_ACT_FINISH, int TASK_PRIORITY,
int TASK_PCT_COMP, int TASK_PCT_WORK_COMP, int TASK_TYPE,
short TASK_FIXED_COST_ACCRUAL, DateTime TASK_DEADLINE,
double TASK_WORK, double TASK_OVT_WORK, double TASK_REG_WORK,
double TASK_ACT_WORK, double TASK_ACT_OVT_WORK, double TASK_REM_WORK,
double TASK_REM_OVT_WORK, double TASK_COST, double TASK_OVT_COST,
double TASK_FIXED_COST, double TASK_ACT_COST, double TASK_ACT_OVT_COST,
double TASK_REM_COST, double TASK_REM_OVT_COST, int TASK_PHY_PCT_COMP,
int TASK_EVMETHOD, int TASK_OUTLINE_LEVEL, string TASK_OUTLINE_NUM,
Guid TASK_CAL_UID, DateTime TASK_START_DATE, int TASK_START_VAR,
DateTime TASK_FINISH_DATE, int TASK_FINISH_VAR, DateTime TASK_RESUME_DATE,
DateTime TASK_STOP_DATE, DateTime TASK_PRELEVELED_START,
DateTime TASK_PRELEVELED_FINISH, DateTime TASK_EARLY_START,
DateTime TASK_EARLY_FINISH, DateTime TASK_LATE_START,
DateTime TASK_LATE_FINISH, DateTime TB_START, DateTime TB_FINISH,
double TB_COST, double TB_WORK, int TB_DUR,
short TB_DUR_FMT, double TASK_BCWS, double TASK_BCWP,
double TASK_ACWP, int TASK_FREE_SLACK, int TASK_TOTAL_SLACK,
bool TASK_HAS_LINKED_FIELDS, string TASK_WBS, int AddPosition,
Guid AddAfterTaskUID, int DurationType, int WOBJ_DOC_REF_CNT,
int WOBJ_ISSUE_REF_CNT, int WOBJ_RISK_REF_CNT, int WOBJ_OTHER_REF_CNT,
DateTime CREATED_DATE, DateTime MOD_DATE, string PROJ_NAME,
int PROJ_TYPE, int PROJ_OPT_CURRENCY_DIGITS,
int PROJ_OPT_CURRENCY_POSITION, string PROJ_OPT_CURRENCY_SYMBOL,
Guid TASK_EXT_PROJ_UID, double TASK_BUDGET_COST, bool TASK_IS_NULL,
double TASK_BUDGET_WORK, string TASK_CONTACT, double TASK_COST_VAR,
double TASK_CPI, double TASK_CV, int TaskCVP, int TASK_START_SLACK,
int TASK_FINISH_SLACK, string TASK_HYPERLINK_FRIENDLY_NAME,
string TASK_HYPERLINK_ADDRESS, string TASK_HYPERLINK_SUB_ADDRESS,
bool TASK_IS_ROLLED_UP, string TASK_NOTES, double TASK_SPI,
double TASK_SV, int TaskSVP, double TASK_TCPI, double TASK_WORK_VAR)
Examples
using PSLibrary = Microsoft.Office.Project.Server.Library;
. . .
public static void CreateTaskRow(
WebSvcStatusing.ProjectDataSet dsProject,
string taskName,
PSLibrary.Task.AddPositionType position,
Guid predecessorGuid)
{
WebSvcStatusing.ProjectDataSet.TaskRow taskRow =
dsProject.Task.NewTaskRow();
taskRow.PROJ_UID = dsProject.Project[0].PROJ_UID;
taskRow.TASK_UID = Guid.NewGuid();
taskRow.AddPosition = position;
if (position == PSLibrary.Task.AddPosition.Middle)
{
taskRow.AddAfterTaskUID = predecessorGuid;
}
taskRow.TASK_NAME = taskName;
dsProject.Task.AddTaskRow(taskRow);
}
See also
Reference
ProjectDataSet.TaskDataTable class