I have an app, which adds a remote event receiver to a list.
This piece works fine, I can see the events firing and I can run some code from them.
The problem is with the ItemAdding and ItemUpdating events - in traditional event receivers it used to be possible to update the field value by setting:
properties.AfterProperties["Title"] = "updated title";
which was setting that field without actually needing to call item.Update() and trigger another ItemUpdating and ItemUpdated event.
This doesn't seem to be working in remote event receivers.
Here's what I'm trying to do:
public override SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties) { SPRemoteEventResult result = new SPRemoteEventResult(); switch (properties.EventType) { case SPRemoteEventType.ItemAdding: properties.ItemEventProperties.AfterProperties["Title"] = "After adding"; break; case SPRemoteEventType.ItemUpdating: properties.ItemEventProperties.AfterProperties["Title"] = "After updating"; break; } return result; }
Any ideas what's missing?
Is that functionality still available in SP2013 remote event receivers?, I can see the current field value in AfterProperties, I just can't update it.