Solved

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

Posted on 2011-09-06
3
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
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 a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

726 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