0

We are using SP2013 on-premise standard edition. In one of site collection we have created several subsites (and sub-subsites). Under root site and subsites there is a list "News" created with same list template.

When user input a new item in subsite list, some logic need to replicate the same item towards the list at the root site.

Once the item is created at two different lists, user will handle the item differently. (For instance, one is deleted and another is modified for new value) Hence, content query webpart is not an option.

I have considered list workflow but I believe workflow cannot create item across site.

Is there any other alternative?

2 Answers 2

1

I got your requirement as below

For some list events in sub-sites, you have to perform some custom operations in a similar list under root site.

You can use Event Receiver in this case to solve your problem. From your requirement I got that you have to override following methods

  1. ItemAdded(SPItemEventProperties)
  2. ItemDeleted
  3. ItemUpdated

Inside the overridden method, check properties.List.Title and properties.WebUrl. You know event receivers are farm solution. So when you deploy an event receiver in a Web Application, It will be triggered for sites under this Web Application.

public override void ItemUpdated(SPItemEventProperties properties)
       {
           if (properties.List.Title == "your list name" & properties.WebUrl == "some url")
           {
               //write your code here
           }
       }
1

You can create items across sites using a SharePoint 2013 List Workflow. The way to do it is by using a call web-service action.

You would just make a call to the root site: http://spsite/_api/web/lists/getbytitle('News')/items

Here's a post with a complete example: http://mysharepointinsight.blogspot.com/2013/05/using-sharepoint-rest-services-from.html

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.