Version

List.Item.delete

This method can be used to delete either an existing item in a SharePoint List or a document in a Document Library. As parameter, it receives a JavaScript object that can include several properties. When the parameter has no properties with contextual information this method relies on user navigation to get the context. For example, after the user navigates to a specific list within a site and tries to delete an item or document , SharePlus can get the site URL, the list or library GUID, the content type, and the item or document GUID. You can use List.Item.delete in two different ways:

  1. From a Mobile Workspace, where you need to provide contextual information like the site URL and list name.

  2. From a Custom Form defined for a list, where you already have contextual information available from the user navigation through the UI.

Syntax

SPlus.List.Item.delete (args, function (result){
        //TODO: Implement what to do when an item/document was successfully deleted
}, function (eResponse){
        //TODO: Implement what to do with the error information
}, function (){
        //TODO: Implement how to handle a user’s cancel
});

List.Item.delete Parameters

Parameter

Type

Description

args

JavaScript Object

The args Object includes a property with the GUID of the item or document to be deleted. And, optionally, contextual information to be used by SharePlus to find the list and the existing item.

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.