CICOCheckedOutInOtherSession CSOM Project 2013
I'm trying to edit a custom field using CSOM, but I'm getting a
CICOCheckedOutInOtherSession exception.
Here's a piece of my code:
PublishedProject proj2Edit = projContext.Projects.GetByGuid(new Guid("X"));
projContext.Load(proj2Edit);
projContext.ExecuteQuery();
DraftProject projChechedOut = proj2Edit.CheckOut().IncludeCustomFields;
projChechedOut.SetCustomFieldValue(GetCustomField(fieldName).InternalName,
"Hello");
QueueJob qJob = projChechedOut.Publish(true);
JobState jobState = projContext.WaitForQueue(qJob, timeoutSeconds); <---
ERROR
private static Guid GetCustomFieldId(string fieldName)
{
var cfList = projContext.LoadQuery(projContext.CustomFields.Where(cf
=> cf.Name == fieldName));
projContext.ExecuteQuery();
return cfList.First().Id;
}
No comments:
Post a Comment