Version

Utility.pickDocument

This method is used to select a document, add it to the files collection and return the filename for later use. The standard iOS document picker is displayed to the user to select a new file. Once the file was added to the files collection, the onSuccess part of the method returns a String with the file name to be displayed and/or used later. The file name is later needed to add an attachment to an item or to add a new document.

Syntax

SPlus.Utility.pickDocument (function (result){
        var filename = result;
        //TODO: Implement what to do with the filename of a file successfully added to the files collection

}, function (eResponse){
        var errorInformation = eResponse['error#displayValue']; //Get error information
        //TODO: Implement what to do with the error information
}, function (){
        //TODO: Implement how to handle a user’s cancel
});

onSuccess callback function

Parameter

Description

function (result)

Success callback function to be implemented. When successful, result returns as an empty dictionary.

onError callback function

Parameter

Description

function (eResponse)

Error callback function to be implemented, which receives the eResponse JavaScript Object.

onCancel callback function

Parameter

Description

function (result)

Cancel callback function to be implemented.