Solved

How to move a list item into a folder within the same list

Posted on 2011-09-06
3
212 Views
Last Modified: 2012-05-12
I have a business requirement to move a list item into a folder within the same list as soon as the item is added. A new folder will be created every day and todays items will be moved to this folder.

To achieve this I have created an 'Item Added' event handler which is attached to the list. What my approach to achieve this is to catch this event in 'Item Added', check if the folder is available for todays date, if not create one, move the item to this folder and may be delete this item. I don't know if moving an item will only be copied or move.

Can anyone please help? Souce code will be highly appreciated.

Thanks
0
Comment
Question by:shieldguy
3 Comments
 
LVL 5

Expert Comment

by:Chris-Vielife
ID: 36487461
Hi

Hi could I suggest something else. As what you are asking I think you would need to hire a contractor to achieve.

You could create the default view for the list to only show items with today's date. All the other items will be hidden from view.

Create to mandatory fields in a custom list. "Date" (Auto Populated with the current days date when created).  

You can create views to only show items from certain date ranges.
0
 
LVL 18

Accepted Solution

by:
ivan_vagunin earned 500 total points
ID: 36487688
Hi!
Your logic seems to be fine. But unfortunately there is no move function for sharepoint list item. You can use CopyTo function of list item (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.copyto(v=office.14).aspx) and Delete. Which code samples do you (folder creation, item moving or something else)?

0
 
LVL 1

Author Closing Comment

by:shieldguy
ID: 36909512
Thanks
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now