Remote Event Receiver in Hostweb
-
10-10-2020 - |
Question
I have a Farm Solution that management is pushing to be ported to the App Model. This Farm solution has a Custom Action which, when configured, dynamically attaches a ListItem Event Receiver to the List chosen by the user.
Is it possible to attach a Remote Event Receiver to a list programmatically ? Can you add a Remote Event Receiver to the Host Web or does it have to exist in the App Web attached to a list in the App Web?
La solution
For your question "Is it possible to attach a Remote Event Receiver to a list programmatically?, The answer is YES. Yes it is possible to attach the remote event receiver programmatically.
We can make use of EventReceiverDefinitionCreationInformation
class to make this possible in AppInstalled
event.
For your query there is perfect article written here
- Attaching Remote Event Receivers to Lists in the Host Web
- RER to Lists in the Host Web
- Adding Remote Event Receivers to list on Host web + Debugging
Let me know if you have any additional issue in implementing this.