Solved

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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)…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
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 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 …

705 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