0

I have a document library which has some documents with metadata fields attached. Some of the metadata fields are edited by a workflow on create / edit. But we are finding when a file is Published from draft to pending, the workflow fires and makes the required change to a metadata tag, and this causes that file to go back into draft mode.

Is it possible to make a change in a workflow and not changing the approval status?

0

In order to make that behavior you need to update the document metadata without firing native event receivers on changes.

If you’re on-premise and your workflow is based on custom development, you can use the trick to disable event firing with SPListItem.SystemUpdate(false)

Otherwise you have another workaround available on on-premise or online by using CSOM or Rest API “SP.ListItem.validateUpdateListItem” Microsoft Documentation: https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj246412(v%3Doffice.15)

CSOM example: https://www.c-sharpcorner.com/blogs/update-a-sharepoint-listitem-without-increasing-its-item-file-version-using-sharepoint-client-side-modelcsom

Rest API explanation: https://robertschouten.com/2018/04/30/update-file-metadata-with-rest-api-using-validateupdatelistitem-method/

Hope it will help you. Have a good day. Regards.

  • Thanks for the reply. but I ran a test using validateUpdateListItem and unfortunately even with the bNewDocumentUpdate flag (i tried both on and off) but it still moved the file into draft.. If I was on Prem it would be easy using SystemUpdate, but it doesnt look like SPO offers anything for this problem – michael May 27 at 12:17

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.