I want the following code to prevent adding any file to a library and silently continue with no error. However when an item is adding and I cancel the result with the CancelNoError
flag SharePoint still displays error message File Not Found. Can the ItemAdding
Event display nothing and just silently continue? What am I missing here?
Thanks!
public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
{
SPRemoteEventResult result = new SPRemoteEventResult();
using (ClientContext clientContext = TokenHelper.CreateRemoteEventReceiverClientContext(properties))
{
if (clientContext != null)
{
clientContext.Load(clientContext.Web);
clientContext.ExecuteQuery();
result.Status = SPRemoteEventServiceStatus.CancelNoError;
}
}
return result;
}