Error - AssignmentCannotEditSummaryTask when using QueueUpdateProject
-
2010年10月26日 13:10
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 fieldint 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.
すべての返信
-
2010年11月2日 21:54所有者
Not sure if this is the only issue Arcy67 - but you cannot read from the published datastore and then submit this dataaset to update the project. You should read from the working store. Also not sure how valid your use of taskId is between your local grid view and the project dataset - but if you resolve the first issue that might be ok.
Best regards,
Brian
Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page -
2012年6月7日 5:01
Hi,
the thread is quite old but as there are very few pages referring to the AssignmentCannotEditSummaryTask message I would like to share my findings here...
I had the same error in a Project Server 2010 system yesterday when we wanted to create projects from an EPT with a plan template assigned.
Reason for the error in our case was that there had been summary tasks with resources assigned to them. Something that you would not recommend to do, but what is technically possible and might be ok if you just use the "resource" column to hold an information meaning something like "responsible".
This seems to be something that the PSI has problems with in some cases.
Regards
Christoph
- 回答の候補に設定 Christoph Muelder 2012年7月13日 5:04