0

I am working on the following scenario inside my sharepoint 2013 enterprise server on-premise.

  1. I have a customer list inside a sub-site http://servername/sites/customer.
  2. now i want to automatically create a new sub-site under the above subsite, when an item inside the customer list is created. and the sub-site will have the same name as the item.

now i found some articles which describe how to do so inside an event receiver and publish it as farm solution.
Altogether this will work for me as i am using on-premise sharepoint,But can anyone adivce if i can implement my above scenario (of creating a sub-site) using APPs instead of Farm solutions?

Thanks

2
  • 1
    Listitem in the list will be created directly from list or using code from app ? Commented Dec 3, 2016 at 4:21
  • @RonakPatel the list item inside the customer list will be created by users, and those users might only have contribute permission on the site. so after the user create a new Customer item,, i need to automatically create a new subsite.
    – John John
    Commented Dec 3, 2016 at 10:15

2 Answers 2

2

This you can achieve through by creating a Remote Event Receiver instead of a farm solution in SharePoint 2013 , to create a Remote Event Receiver you should develop a Provider Hosted App.

In Remote Event Reciever you can handle all list item events like normal event recievers and you can write the logic over there as per your requirements.

Please refer the below article for more info on RERs :

https://msdn.microsoft.com/en-us/library/office/jj220043.aspx

6
  • thanks for the link, so seems i will need to create a Remote Event receiver which will require to host additional web application, which will complicate the case. so since i am using on-premise 2013 ,, so is it totally wrong to develop an event receiver solution to implement my requirement ? i am a bit confused on if we should avoid using farm solutions in SP 2013??
    – John John
    Commented Dec 3, 2016 at 10:12
  • 1
    Yes , if you don't want to go with farm solution for creating an event receiver then we have Provider Hosted Apps as a other option . yes here it'll be hosted as a web service in a web application. yes you can avoid farm solution as much as possible since it puts more load on the server.
    – Esaki
    Commented Dec 3, 2016 at 10:20
  • but if i implement my requirement as an event receiver using farm solution,, will this be totally wrong approach ? because i find developing a farm solution in my case will be much easier comapred to create a remote event receiver (APP) ?? or i should use APP an why??
    – John John
    Commented Dec 3, 2016 at 10:58
  • 1
    yes if you're only going to create a event receiver then you can go with farm solution.
    – Esaki
    Commented Dec 3, 2016 at 11:18
  • can you please adivce what do you mean by "yes if you're only going to create a event receiver then you can go with farm solution" thanks
    – John John
    Commented Dec 3, 2016 at 23:34
1

If you do not want to use Farm solution then either you can use Remote Event Receiver or you can create Sandbox Solution with list & event receiver.

1
  • now i did not work on Remote Event Receiver but seems they must run on a separate IIS website. so can this website be created inside the same IIS as for where the sharepoint web applications are created? second question now if i use normal event receivers or remote event receivers can i force the event receiver to create a sub-site even if the user who fires the event receiver does not have the required permission to create sub-site (such as user with contribute permission )? i mean if a contributor user create a list item, then can the event receiver which will fire create a sub-site?
    – John John
    Commented Dec 3, 2016 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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