I am trying to create a Remote Event Receiver for whenever an item is adding.
I can't debug it as I have read that debugging Remote Event Receivers requires (Amongst other things) SharePoint 2013 installed on the development server (which mine is windows 7 so I can't install SharePoint 2013). Correct?
So until I setup a virtual box with Windows 2008 server I am flying blind with my Remote Event Receiver.
I have added the AllItemsReceiver
to my site with the below XML:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="100">
<Receiver>
<Name>AddItemsRecieverItemAdding</Name>
<Type>ItemAdding</Type>
<SequenceNumber>10000</SequenceNumber>
<Url>~remoteAppUrl/Services/AddItemsReciever.svc</Url>
</Receiver>
<Receiver>
<Name>AddItemsRecieverItemUpdating</Name>
<Type>ItemUpdating</Type>
<SequenceNumber>10000</SequenceNumber>
<Url>~remoteAppUrl/Services/AddItemsReciever.svc</Url>
</Receiver>
<Receiver>
<Name>AddItemsRecieverItemAdded</Name>
<Type>ItemAdded</Type>
<Url>~remoteAppUrl/Services/AddItemsReciever.svc</Url>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
</Receivers>
</Elements>
Then I have added the following method:
public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
{
SPRemoteEventResult result = new SPRemoteEventResult();
result.Status = SPRemoteEventServiceStatus.CancelWithError;
result.ErrorMessage = "You can not add anything";
return result;
}
I then install the app, but when I go to lists/mylist and click Add item, it adds without issue?