locked
Workflow error in document library RRS feed

  • Question

  • Hi,

    I have a document library and I have attached a designer workflow to it. The workflow is supposed to update one of the field in document library. But it is showing error as "The file filename.txt has been modified by sidhanta on 21 Aug 2013 13:03:10 +0530".

    Following some forums and blogs we are using paused for duration / delay in workflow activity before the update action. It is working but it is not accepted everywhere.

    Please suggest me way out. I am using sharepoint 2010 and sharepoint designer 2010.


    With Thanks

    Sidhanta Tripathy


    • Edited by Sidhanta Wednesday, August 21, 2013 7:41 AM
    Wednesday, August 21, 2013 7:40 AM

Answers

  • Hi Sidhanta,
    According to your post, the workflow associated with a document workflow cannot work and it  generate an error.

    Do you start the workflow when an item is created?
    If yes, as soon as a file is uploaded, an item corresponding to SPFile is initiated and it’s version is set to 1.
    At this point two operations occur on separate threads: Initiation of the workflow; Redirect to EditForm.aspx which will load the ListItem information from SPContext.
    If the update item action in the workflow completes before EditForm.aspx load, we will get the correctly updated fields on EditForm.aspx.
    If the update item action in the workflow hasn’t finished execution, the ItemContext loaded on EditForm.aspx is the version 1 (because Version1 is the only one that exists).
    At this point, we will get the error like you got.

    I recommend to create an event receiver to trigger the workflow.
    Please per the link below:
    http://zimmergren.net/technical/starting-a-sharepoint-workflow-from-code-event-receiver
    http://www.tonytestasworld.com/post/Howto-Start-a-Sharepoint-Workflow-Programmatically.aspx

    Best regards.
    Thanks

    • Marked as answer by Victoria Xia Thursday, August 29, 2013 10:14 AM
    Thursday, August 22, 2013 10:10 AM