List.Item.updateItem
This method is used to modify an existing item in a SharePoint List. 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 modify an item, SharePlus can get the site URL, the list GUID, the content type, and the item’s ID.
You can use List.Item.updateItem in two different ways:
-
From a Mobile Workspace, where you need to provide contextual information like the site URL and list name.
In this case you can use List.getListMetadata to get the content types and required fields from the list. In the case that you need the GUID of the list, you can get it using the Web.getWebsAndLists method.
-
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.updateItem (args, function (result){
}, function (eResponse){
}, function (){
});
List.Item.updateItem Parameters
Parameter |
Type |
Description |
args |
JavaScript Object |
The args Object includes a property with the attributes of the item to be edited. And, optionally, contextual information to be used by SharePlus to find the list and the 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. |