Version

SPlusBridgeDataType

You can use SPlusBridgeDataType to provide special values (lookup, user, and URL fields) as the attributes of a new item or item to be updated. SPlusBridgeDataType has three data types: SPLookupValue, SPUserValue, and SPURLValue.

Note

Note: All three data types receive String values in their constructors.

SPLookupValue Syntax

var lookupId = country_id;
var lookupValue = country_value;

var countryField = new SPlusBridgeDataType.SPLookupValue(lookupId, lookupValue); // Create a new object with the lookup field

var args = {'Title':taskName,'StartDate':sDate,'Priority':priority, 'Assigned_x0020_To':assigned, 'Country':countryField}; //args Object with the new attributes of the item to be edited, including the lookup field

// Invoking List.Item.updateItem API method.
SPlus.List.Item.updateItem (args, function(result) {
     // Implement what to do when an item was successfully edited
}, function(response) {
     // Implement how to handle errors
}, function() {
     // Implement how to handle a user’s cancel
});

SPUserValue Syntax

var lookupId = user_id;
var loginName = user_login;
...

var userField = new SPlusBridgeDataType.SPUserValue(lookupId, loginName, displayName, emailAddress, sipAddress, title); // Create a new object with the user field

var args = {'Title':taskName,'StartDate':sDate,'Priority':priority, 'Assigned_x0020_To':assigned, 'User':userField}; //args Object with the new attributes of the item to be edited, including the user field

// Invoking List.Item.updateItem API method.
SPlus.List.Item.updateItem (args, function(result) {
     // Implement what to do when an item was successfully edited
}, function(response) {
     // Implement how to handle errors
}, function() {
     // Implement how to handle a user’s cancel
});

SPURLValue Syntax

var url = url_value;
var description = url_description;

var URLField = new SPlusBridgeDataType.SPLookupValue(url, description); // Create a new object with the URL field

var args = {'Title':taskName,'StartDate':sDate,'Priority':priority, 'Assigned_x0020_To':assigned, 'URL':URLField}; //args Object with the new attributes of the item to be edited, including the URL field

// Invoking List.Item.updateItem API method.
SPlus.List.Item.updateItem (args, function(result) {
     // Implement what to do when an item was successfully edited
}, function(response) {
     // Implement how to handle errors
}, function() {
     // Implement how to handle a user’s cancel
});