Automatically copy list data from one list to another list after 1 month

六眼飞鱼酱① 提交于 2019-12-05 10:23:23

First I would want to question WHY you want to move it to another list?

Why not simply setup a view on your main list showing only records created in last 30 days :-

Created >= [Today]-30

(And yes, you can use Today in view filters)

code master

The best way to proceed is to create a timer job and define the criteria (like when should it be running) while creating the job. We have a very helpful post by SharePoint MVP here on how to create custom jobs. Note, you can test the job and business logic for shorter duration and if it works fine, you can simply extend the job duration for 30 days.

Its very simple, all you have to do is to define your 'copying list' logic in the Execute method of job class. Good luck

I believe you can simply use standard out-of-the-box workflow activities to do this - no need for timer jobs or console apps.

Using SharePoint Designer, create a new workflow (New -> SP Content -> Workflow). Specify the list to attach the workflow to.

Specify that the workflow should start on item creation only.

In the first Step, add an action: Pause for duration. Make the duration 30 days.

Add another action: Copy list item. Specify the list to copy to.

Optionally: create a third action: Delete list item if you want the original item to be deleted from the original list.

And I think that's it :)

you have to crate a timer job which runs daily and move the items which are one month old

Potentially the easiest solution is to create a console application that you schedule to run on the SharePoint server (an alternative to creating a timer job).

Depending on how you want to archive the data, you could:

Old1953

There's a limit on number of items in a list of 5000 items and if you change this in administration you'll kill performance. There are perfectly valid reasons to want to archive old items off of a rapidly growing list. exceeds the list view threshold 5000 items in Sharepoint 2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!