0

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)?

1 Answer 1

1

Can you check and see if the Minimal Download Strategy Site feature is activated by going to Site Settings -> Site features -> Minimal Download Strategy

In case of sites with MDS enabled, there are chances of error message not being displayed as mentioned here

1
  • I tried with MSD enabled and disabled. Same thing - nothing returned/displayed.
    – obautista
    Aug 7, 2017 at 14:10

Your Answer

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

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