I have an asynchronous remote event receiver that updates a number of fields when ItemAdded fires, it uses the app context for the ClientContext.

Everything is working when i upload a file the RER works perfectly but when the file is created using the default "New" button the RER will have some error saying that [[1]

This error appears because when you create a file using the "New" Button it will automatically open that in a "ms word online" thus locking the file to the user who created it. now is there a way to make my RER work a csom code for unlocking will be great?


1 Answer 1


The file might be locked because:

  • The file is shared and another user is currently editing it.

  • An instance of the Office app is running in the background with the file already opened.

  • The file has been marked as Final and can no longer be updated.

If someone is currently working on the file, you can either wait for that person to close it, or you can create a copy of the file and enter your changes in the copy. (Alternatively, you could switch to an app that allows multiple authors to work on a file simultaneously.)

Use the following procedures to create a copy on your mobile device. If you choose to enter your changes in a copy, it’s a good idea to use tracked changes so that you can easily move your changes to the shared file when it becomes available. You can turn on tracked changes on the Review tab.

for more please take a look.

  • I know the reason why i'm having an error, as what I've stated in the description. now I was looking for a way to unlock the fire so my event receiver can do its job and populate fields i need. probably a csom code to unlock a file will be great
    – Beenee
    Nov 20, 2018 at 8:31
  • can i know the reason? is it open by someone else?
    – Negi Rox
    Nov 20, 2018 at 8:42
  • the flow of the process is basically i'm doing an auto-tag feature wherein i get the properties of the parent folder and add them to the fields of the uploaded file When file is added using uploading 1) User adds and item via dragging a file to a document library 2) Remote Event Receiver populate some fields that i get using csom via item added 3) Done When file is created using the "New" Button 1) User clicks "New" 2) Sharepoint "opens word online app" 3) Remote Event Receiver fires -> Error happens because of no.2 Now im using the app token therefore i dont have the user ctx
    – Beenee
    Nov 20, 2018 at 9:49
  • if file is open by someone then you will still get a same error. no matter either you are using app token or not.
    – Negi Rox
    Nov 20, 2018 at 10:11
  • That's why I'm asking if there is a workaround with that or how could my event receiver do its job with the said problem.
    – Beenee
    Nov 20, 2018 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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