none
Question on PSI: task dates fields update RRS feed

  • Question

  • I using this code below to update task fields. But project always automatically change it.

    I trying to update two tasks, where first task is predecessor for the second task.

    taskRow.SetTASK_FINISH_DATENull();
    taskRow.SetTASK_START_DATENull();

    taskRow.SetTASK_PCT_COMPNull();

    taskRow.SetTASK_CONSTRAINT_DATENull();
    taskRow.SetTASK_CONSTRAINT_TYPENull();

    if (ShortName == "Task 1")
    {
    taskRow.TASK_CONSTRAINT_TYPE = 4;// (short)ConstraintType.StartNoEarlierThan;
    taskRow.TASK_CONSTRAINT_DATE = newStartDate;
    }
    else
    {
    taskRow.TASK_CONSTRAINT_TYPE = 0;// (short)ConstraintType.AsSoonAsPossible;
    }

    taskRow.SetTASK_ACT_WORKNull();

    taskRow.TASK_START_DATE = newStartDate;

    taskRow.TASK_FINISH_DATE = newFinishDate;

    taskRow.SetTASK_PCT_COMPNull();
    taskRow.TASK_PCT_COMP = newPercentCompleted;

    Result: Project wrote wrong constraint type, it can change duration, set percent to '0' or scaling percent.

    I want project should only to change second tasks dates, because of dependency.

    Tuesday, August 29, 2017 7:22 AM