EPMFAQ Forums - Connect with the EPM Community  

Go Back   EPMFAQ Forums - Connect with the EPM Community > Microsoft Project Forums > Project 2007 Development


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-26-2010, 11:25 AM
Junior Member
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Error - AssignmentCannotEditSummaryTask when using QueueUpdateProject

I am attepting to put together a web application to update selected project tasks on a Project Server 2007 installation. The code I am using is (for the most part) taken directly from the code example in the SDK under the QueueUpdateProject method. I am simply attempting to update the TASK_NAME field on one Task record on an existing project and nothing else. The problem is that upon calling QueueUpdateProject - I am getting error 135 - AssignmentCannotEditSummaryTask for what looks to be several Assignment records. The task I am updating is NOT a summary task. To further complicate things - this error happens even if I comment out the code that makes the change to the project DataSet (not updating the project DataSet at all). Here are the steps I am taking and the results I receive:

SCENARIO 1:
  • read the project details using ReadProject - SUCCESSFUL
  • check out the project using CheckOutProject - SUCCESSFUL
  • update the TASK_NAME field - SUCCESSFUL
  • call QueueUpdateProject - ERROR HAPPENS HERE

SCENARIO 2:
  • read the project details using ReadProject - SUCCESSFUL
  • check out the project using CheckOutProject - SUCCESSFUL
  • call QueueUpdateProject (no changes to the project DataSet) - ERROR HAPPENS HERE

SCENARIO 3: (this Scenario works fine)
  • read the project details using ReadProject - SUCCESSFUL
  • check out the project using CheckOutProject - SUCCESSFUL
  • check in the project using CheckInProject - SUCCESSFUL

And here is the actual code I am using:

protected void Button1_Click(object sender, EventArgs e)
{

q.Url = baseUrl + QUEUEWEBSERVICE;
q.Credentials = CredentialCache.DefaultCredentials;

Button Button1 = (Button)sender;
GridViewRow grdRow = (GridViewRow)Button1.Parent.Parent;
Label5.Text = grdRow.Cells[2].Text; //TASK_NAME field

int taskId = Convert.ToInt32(grdRow.Cells[8].Text); //TASK_ID field

int idx = grdRow.DataItemIndex;

//Get the Project ID from the GridView DataKeys collection
Label6.Text = GridView2.DataKeys[idx].Value.ToString();
Guid projectId = new Guid(GridView2.DataKeys[idx].Value.ToString());

Guid sessionId = Guid.NewGuid();
Guid jobId = Guid.NewGuid();

//Read the Project Details
WebSvcProject.ProjectDataSet projectDs = project.ReadProject(projectId, WebSvcProject.DataStoreEnum.PublishedStore);

//Check Out the Project
project.CheckOutProject(projectId, sessionId, SESSION_DESC);

//Update the Task field on the local DataSet
Label7.Text = "DS VALUE : " + projectDs.Task[taskId].TASK_NAME.ToString();
projectDs.Task[taskId].TASK_NAME += " Changed";

//Save the changes
project.QueueUpdateProject(jobId, sessionId, projectDs, false);
WaitForQueue(q, jobId);

// Check in the project
jobId = Guid.NewGuid();
project.QueueCheckInProject(jobId, projectId, false, sessionId, SESSION_DESC);
WaitForQueue(q, jobId);

}

I am VERY new to Project Server development so any assistance would be greatly appreciated.

Thanks in advance,
Rob








Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -4. The time now is 08:19 AM.


Powered by: vBulletin®
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Ad Management by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24