Hi,
we are currently developing a provider-hosted app for SharePoint with an Azure-hosted remote web.
We need to handle an ItemDeleting event, so we have added an ItemDeleting remote event receiver for the specific list. In the ProcessEvent() method of the remote event receiver, we need to load the item, which is going to be deleted, because we need some field information from the item.
But the event receiver functionality does not work.
We have applied the steps mentioned in the following blog entry in order to debug the remote event receiver:
While doing so, we are able to locate the exception which is obviously thrown in the event receiver: it is not possible to load the list item because the item does not exist anymore.
So, the question is, what is the sense of an ItemDeletING event in comparison to an ItemDeletED event if the list item is already deleted when the remote event receiver runs?
The blog entry above also says:
Depending on the event, the remote event may be synchronous or asynchronous. It might take a few more seconds or more to hit your breakpoint if it is asynchronous. Events that are “* being *”—like “item is being added”, “item is being deleted”—are synchronous. Events that are “* was *”—like “item was added”, “item was deleted”—are asynchronous.
Our test case shows the contrast. The ItemDeleting event seems to be asynchronous...
Best regards,
Dustin