Getting data from all lists in subsites.
Hi, I have a site and multiple subsites. Most of the subsites have list to it which is of common format(same column etc ). The subsites are created on regular basis. User needs to collate the information from all the lists, which he does manually by going to each of the list and copying it to a spread sheet. What is the best possible way to automate it. I dont want to have a scheduler job based on Object model to mimick the manual task of looping through all subsites and lists to collect the data. Is there a better way to help the user out ? Thanks !siaj
July 26th, 2011 1:51pm

Hi, For the scenario you have mentioned the the timer jobs are best option. However you can do it via event receivers also. As you have stated that your all all lists in all subsites are going to have same set of columns, thus you can define a single content type to be used in all such lists. You can then create an event receiver and attached it to the content type now whenever a list will be created with this content type the event receiver will be attached automatically. Now you can implement these 2 methods: public override void ItemAdded(SPItemEventProperties properties) { //Implement your logic to add an entry to your main list when an item is added in any such list } public override void ItemUpdated(SPItemEventProperties properties) { //Implement your logic to add an entry to your main list when an item is updated in any such list } public override void ItemDeleted(SPItemEventProperties properties) { //Implement your logic to add an entry to your main list when an item is deleted in any such list } I hope this will help you out. Thanks, Rahul Rashu
Free Windows Admin Tool Kit Click here and download it now
July 26th, 2011 10:05pm

Thanks much Rahul. Thats a great idea. Thanks ! siaj
July 27th, 2011 12:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics