Quantcast
Channel: Question and Answer » web-services
Viewing all articles
Browse latest Browse all 136

How to use the OOTB SubmitFile ( _vti_bin/Officialfile.aspx) functionality cientside for multiple selected documents?

$
0
0

I have a custom action in the ribbon which execute a javascript function. Inside this javascript I can loop into all selected documents. I would like to implement the OOTB send file functionality clientside. How to do that?

This is the url when you do it manual in the userinterface to send a file to the DropOffLibrary in the Record Center:

http://myCompany.com/sv/sv_000124/_layouts/15/SendToOfficialFile.aspx
?ID = rm0001
&Index = beb7b694-9aef-40b2-8910-a6637e138032
&SourceUrl = %2Fsv%2Fsv%5F000124%2FGedeelde%20documenten%2FScrum%2DGuide%2DNL%2Epdf
&Source = http%3A%2F%2FmyCompany.com%2Fsv%2Fsv_000124%2FGedeelde%20documenten%2FForms%2FAllItems.aspx%3FInitialTabId%3DRibbon.Document%26VisibilityContext%3DWSSTabPersistence
&InitialTabId = Ribbon%2EDocument
&VisibilityContext = WSSTabPersistence

I know also there is a webservice: _vti_bin/Officialfile.asmx

My current clientside code:

function EnableFinishedButton() 
{
    var context = SP.ClientContext.get_current();
    var list;
    var selectedItems = SP.ListOperation.Selection.getSelectedItems(context);
    var totalSelectedItems = CountDictionary(selectedItems);

    if (totalSelectedItems > 0) 
    {
        var web = context.get_web();
        context.load(web);
        var listId = SP.ListOperation.Selection.getSelectedList();
        list = web.get_lists().getById(listId);

        for (i in selectedItems) 
        {
            var item = list.getItemById(selectedItems[i].id);
            // HERE I WOULD LIKE TO SEND THIS DOCUMENT TO THE RMA (Record Management Application) DROPOFFLIBRARY
        }
    }   
}

Viewing all articles
Browse latest Browse all 136

Trending Articles