none
PSI Error creating task in existing project RRS feed

  • Question

  • Dear Experts

    I am adding some tasks to my existing project plan through PSI but am getting SOAP error

    My code part is :

    WebSvcProject.ProjectDataSet PjDS = svProj.ReadProject(ProjUID, WebSvcProject.DataStoreEnum.WorkingStore);

    Guid TaskUID = Guid.NewGuid();

    Guid sessionUID=Guid.NewGuid();

    Guid jobUID;

    string session_desc="Updating Project";

    WebSvcProject.ProjectDataSet.TaskRow newTask = PjDS.Task.NewTaskRow();

    svProj.CheckOutProject(ProjUID, sessionUID, session_desc);

    newTask.PROJ_UID = ProjUID;

    newTask.TASK_UID = TaskUID;

    newTask.TASK_NAME = "ITs New Task " + DateTime.Now.ToShortTimeString();

    newTask.TASK_DUR_FMT = (int)PSLibrary.Task.DurationFormat.Day;

    newTask.TASK_DUR = 4800 * 2;

    newTask.TASK_START_DATE = DateTime.Now.AddDays(3);

    PjDS.Task.AddTaskRow(newTask);

    jobUID = Guid.NewGuid();

    svProj.QueueUpdateProject(jobUID, sessionUID, PjDS, false);

    WaitForQueue(svQueue, jobUID);

    jobUID = Guid.NewGuid();

    svProj.QueuePublish(jobUID, ProjUID, true, string.Empty);

    WaitForQueue(svQueue, jobUID);

    jobUID=Guid.NewGuid();

    svProj.QueueCheckInProject(jobUID, ProjUID, false, sessionUID, session_desc);

    WaitForQueue(svQueue, jobUID);

     

    Am waiting for reply. J


    Avinash kumar | e2eProjects Pvt. Ltd
    Saturday, December 24, 2011 11:37 AM

Answers

  • Sorry I was using wrong method to add task to existing project.

    Answer is :

    Instead of using this method:

    svProj.QueueUpdateProject(jobUID, sessionUID, PjDS, false);

    We have to use this method:

    svProj.QueueAddToProject(jobUID, sessionUID, PjDS, false);


    Avinash kumar | e2eProjects Pvt. Ltd
    Saturday, December 24, 2011 12:41 PM