Error with QueueAddToProject

I

Ismael

I have the next method for creating tasks into a existing project:

public void CreateTask(string ProjectID, string TaskName
, string start, string duration)
{
try
{
Guid projectGuid = new Guid(ProjectID);
Guid sessionGuid = Guid.NewGuid();
const string SESSION_DESC = "description";

project.CheckOutProject(projectGuid, sessionGuid, SESSION_DESC);

dsProject = new
w2003wss1.ProjectDataSet(); w2003wss1.ProjectDataSet.TaskRow taskRow =
dsProject.Task.NewTaskRow();

Guid taskGuid = Guid.NewGuid();
taskRow.PROJ_UID = projectGuid;
taskRow.TASK_UID = taskGuid;
taskRow.TASK_NAME = TaskName;
taskRow.TASK_START_DATE = DateTime.Parse(start);
taskRow.TASK_DUR = Convert.ToInt32(duration);
taskRow.TASK_DUR_FMT = (int)PSLibrary.Task.DurationFormat.EstHour;

dsProject.Task.AddTaskRow(taskRow);

Guid jobGuid = Guid.NewGuid();
bool validateOnly = false;
project.QueueAddToProject(jobGuid, sessionGuid, dsProject, validateOnly);

System.Threading.Thread.Sleep(5000);

jobGuid = Guid.NewGuid();
project.QueueCheckInProject(jobGuid, projectGuid, false, sessionGuid,
SESSION_DESC);
}
catch (Exception e)
{
throw e;
}
}

When QueueAddToProject() method is executed, an exception appears:

System.Web.Services.Protocols.SoapException: ProjectServerError(s)
LastError=GeneralOnlyInsertsAllowed Instructions: Pass this into
PSClientError constructor to access all error information
at
Microsoft.Office.Project.Server.WebService.Project.QueueAddToProject(Guid
jobUid, Guid sessionUid, ProjectDataSet dataset, Boolean validateOnly)

What happen? How can I solve this problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top