1

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?

3

You should configure service bus to debug remote event receivers. Please read my two full step-by-step articles (with information about service bus configuration) about Remote Event Receivers in SharePoint Online:

1) Creating and Debugging of Remote Event Receivers for SharePoint Online http://blog.virtosoftware.com/2014/12/creating-and-debugging-of-remote-event.html

2) Adding Remote Event Receivers to list on Host web + Debugging http://blog.virtosoftware.com/2015/01/adding-remote-event-receivers-to-list.html

Hope it helps ;)

-2

change the app url to the local hosturl where you app is hosted.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • 1
    Can you please add more details about how to do what you propose, and what the purpose is? :) – Robert Lindgren Jul 28 '14 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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