I have a squential workflow that takes Account IDs as plain text from a InfoPath input and converts them into a SPUser field. I can't get the the item to update bc an exception is throw on the Update statement and SystemUpdate.

 CurrentItem["Stakeholders"] = usercollection; //Type: SPFieldUserValueCollection
 workflowProperties.Item.SystemUpdate(false); //Exception here         
 //workflowProperties.Item.Update();  //Exception here

//CurrentItem Definition
private SPListItem CurrentItem
         SPList list = workflowProperties.Web.Lists[workflowProperties.ListId];
         SPListItem li = list.GetItemById(workflowProperties.ItemId);
         return li;

I've tried checking the item in and out. That doesn't seem to work. I've tried CurrentItem.Item.File.Update(). This does not throw the exception but it doesn't update the item either.

Any help would be much appreciated.


found this in ULS:

Leaving Monitored Scope (EnsureListItemsData#1). Execution Time=16.7994116570681

<nativehr>0x81020015</nativehr><nativestack></nativestack>The file has been modified by SHAREPOINT\system on 03 Mar 2015 12:53:34 -0600.

Possible mismatch between the reported error with code = 0x81070901 and message: "The file has been modified by SHAREPOINT\system on 03 Mar 2015 12:49:15 -0600." and the returned error with code 0x81020037.
  • You're probably causing the workflow to fire again when you make edits to the column value. When is the workflow supposed to fire, upon creation and edits? – jpollar Mar 3 '15 at 21:07
  • It's supposed to handle both events. the method that contains this code runs on both events. – ExceptionLimeCat Mar 3 '15 at 21:55

Okay I found the issue. Typical dumb mistake from staring at this too long...

CurrentItem["Stakeholders"] = usercollection;                
CurrentItem.Update(); //NOT workflowProperties.Item.Update();

Problem is now the value isn't setting but that's a separate issue. Hopefully this helps someone.

  • Excellent. Mark your own answer as correct. ;) – jpollar Mar 4 '15 at 19:30
  • Please accept your own answer as answer, so that the question will not reflect in unanswered questions list. – P S Apr 18 '16 at 5:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.