Solved

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

Posted on 2011-09-06
3
214 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
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…

773 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