I created a Remote Event Receiver Provided Hosted Addin and attached it to my Doc Lib for my on-prem environment. RER Event Type is for ItemUpdated. It work as expected. The only problem is I would like to cancel the Event Receiver and display the error message on the SharePoint list page to let the user know there was a problem. Event Receiver is triggered, but exception message is not being displayed, which makes it looks like there are no problems (when there are).
public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties) {
SPRemoteEventResult result = new SPRemoteEventResult();
try {
switch (properties.EventType)
{
case SPRemoteEventType.ItemUpdated:
HandleItemUpdated(properties);
break;
}
return result;
}
catch (Exception exception) {
result.ErrorMessage = exception.Message;
result.Status = SPRemoteEventServiceStatus.CancelWithError;
return result;
}
}
Not sure what I am missing. How do I make the error message display on the SharePoint page (where properties are updated)?