0

I have a document library in SharePoint Online with remote event receivers to capture item updating and item updated events.

In the library content approval is enabled and the OOTB Approval workflow is attached to do the approval when a major version of the document is published. When approval is completed or rejected using this approval workflow the document's approval status gets updated.

However this change in approval status is not firing the item updated and item updating event receivers attached to the document library.

Is this an expected behavior in SharePoint Online...???

  • I believe this is expected because otherwise, the update in status would cause a change in version, which would lead to an infinite approval process. – Eric Alexander Aug 15 '16 at 17:09
  • I managed to figure out the reason why it was not getting captured in the remote event receiver. It seems the client context is null in the event receiver when the item updating/updated event is triggered for approval status change using the approval workflow. – Suresh Kumar Senapati Aug 19 '16 at 9:31
1

Try using this workaround.

Added a custom field Status and in the approval workflow update the custom Status field.

Probably this way, your Event Receiver might get triggered.

  • Editing the OOTB approval workflow does not seem to be a possible option for me because its attached during the library creation step. – Suresh Kumar Senapati Aug 17 '16 at 6:34
  • 1
    Can you replicate approval wf in a custom wf and then follow my suggested answer. – bkk Aug 17 '16 at 6:44
  • i know this works when we use custom workflows. I am interested to know why the remote event receivers are not working when OOTB approval workflows are used in a library. – Suresh Kumar Senapati Aug 17 '16 at 7:45
  • Not sure about the reason but as mentioned by Eric, it appears to be by design. – bkk Aug 17 '16 at 9:40

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.