none
SPD Delete Item in Workflow RRS feed

  • Question

  • Hi,

    I have a workflow which upon publishing a document for the first time in Library A, will copy this published version of item to Library B.

    Then the document will be worked on again in Library A (version 1.1, 1.2 etc.) until it is published again. This time the workflow will check if this items ID (ID written to column by workflow) already exists in Library B, and if it does, then delete this item, then copy the latest published version from Library A to B. 

    This workflow works fine, however now I am trying to create an event receiver for Library B, which will remove a property from the document when it's added to library B. 

    This Event Receiver works fine, until the second time when an item is copied over to Library B. I'm thinking this has to do with how SPD deletes items?

    Will the item be treated as an addition to library, or an update?

    How is the item deleted by SPD?

    (Versioning is turned off in Library B)

    Thanks! 


    Daniel Margison





    Sunday, June 4, 2017 10:17 PM

Answers

  • Hi Daniel,

    As I understand, the SharePoint workflow will totally remove the document.

    And in the second time, the library B which disabled Versioning, the workflow will copied document as a new addition one, it will have a new item id, so it's not an update.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


    Tuesday, June 6, 2017 1:12 AM
  • Hi Daniel,

    As Jerry mentioned, if you delete the document in A, then copy from B to A it will be a new document with a new ID.

    If you DON'T delete the document in A, but just copy from B to A, it should overwrite the document in A and keep the ID, and the "Item Updating" and "Item Updated" events will trigger (not "Item Adding" or "Item Added").

    If it is a new document then the "Item Adding", "Item Added", "Item Updating" and "Item Updated" events will trigger.

    Cheers,

    Grant.

    Tuesday, June 6, 2017 5:25 AM

All replies

  • Hi Daniel,

    As I understand, the SharePoint workflow will totally remove the document.

    And in the second time, the library B which disabled Versioning, the workflow will copied document as a new addition one, it will have a new item id, so it's not an update.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


    Tuesday, June 6, 2017 1:12 AM
  • Hi Daniel,

    As Jerry mentioned, if you delete the document in A, then copy from B to A it will be a new document with a new ID.

    If you DON'T delete the document in A, but just copy from B to A, it should overwrite the document in A and keep the ID, and the "Item Updating" and "Item Updated" events will trigger (not "Item Adding" or "Item Added").

    If it is a new document then the "Item Adding", "Item Added", "Item Updating" and "Item Updated" events will trigger.

    Cheers,

    Grant.

    Tuesday, June 6, 2017 5:25 AM