I have a remote event receiver attached to a Document Library. The er is attached to ItemAdding and ItemUpdating. The same code runs on both events to update values in several columns based on the URL of the updated item.

If a file is added or updated, everything works as expected. If a folder is updated, it also works.

When a folder is added, the er is triggered and processes everything successfully, returning a continue status, but my updates aren't being saved. I can then update the folder (a simple rename will work) to trigger ItemUpdating, and the same er is triggered again and this time my updates are saved.

I've attached a debugger and can watch the ItemAdding event run successfully without errors and all the values appear to be set correctly.

Code snippet:

result.ChangedItemProperties.Add("Office", officeName);

properties.ItemEventProperties.BeforeProperties.Add("Office", officeName);

result.Status = SPRemoteEventServiceStatus.Continue;

return result;
  • What's the expected behavior? Adding stuff to the result or properties objects isn't going to actually do anything. Unless you consume it further downstream. – Derek Gusoff Feb 5 '19 at 16:35
  • I'm trying to set the column value for newly added folders. As mentioned, this same code works to set the column when it's a file being added. The code also works correctly when called on ItemUpdating. – Andrew Kennel Feb 5 '19 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.