Learning SharePoint   Enhance Your SharePoint Knowledge

Subscribe to Learning SharePoint Subscribe
Twitter Learning SharePointFollow Us
in Learning SharePoint
Check Out Our New SharePoint 2013 series!

SharePoint 2010 ECMAscript – Copy\Move files to another document library

05/28/2011  
Category: SharePoint 2010


In this post we see a detail example of creating a Ribbon button which when clicked will copy the selected documents from a document library to a pre-defined library (destination library) using ECMAScript.

The steps that user will follow to Copy the the files -
1. Select documents in document library.
2. Click on Copy Documents button in “Manage group” of ribbon.
3. User will be notified via notification that the selected files has been moved.

Steps -
1. Open Visual studio 2010 and create a Empty SharePoint project.
2. Deploy as a sandbox solution.
3. Right click on the Feature and click “Add Feature”

3. Right click on the project and add a new “Empty Element” item.

4. Now, we will add the code for creating a custom button (under Documents tab in the Manage group) which will get displayed in your document library. Also in the “commandAction” you will see the ECMAScript needed for copying the selected documents to the destination library. In this example destination library is hardcoded but you can always create a custom modal dialog for asking user about the destination library.

The button will look something like below -

See the complete code and notifications in Part 2 >>

Subscribe to Learning SharePoint Subscribe
Twitter Learning SharePointFollow Us
in Learning SharePoint
Advertisement

Random Posts

Programmatically set retention policy SharePoint 2010
Programmatically set retention policy»

When it comes to applying your retention schedule to your content, you have two choices. You can attach the retention»

Interview Questions SharePoint 2010
Interview Questions SharePoint 2010

Q. How does Ribbon works ? Ans. A file called CMDUI.XML stays at the web front end which contains the»

SharePoint 2010 Workflow Interview Questions
SharePoint 2010 Workflow Interview»

These are the basic level questions which can be asked in a interview. I will write a separate Post for»

Recent Forum Posts

Linq to Sharepoint

by RS on May 18, 2012

comments on the code

by spbsmile on May 18, 2012

connection(add) EditControlBlock and my program

by spbsmile on May 18, 2012

Custom master pages used in multiple SharePoint 2010 sites

by ubersteve on May 18, 2012

upload file and click on button but cant upload file into list by using below code

by santhoshreddy on May 18, 2012