Salesforce.updateObjectById()

Update a salseforce object given Id and new values.

Requires authentication with username, password, and secret token.

Usage

Hover over inputs/exits for more info.

var Salesforce = require('machinepack-salseforce-expanded');


// Update a salseforce object given Id and new values.

Salesforce.updateObjectById({

email: 'user@gmail.com',

password: 'demo1234',

token: 'x1x2x3',

objectType: 'Lead',

objectData: {},

url: 'https://cs2.salesforce.com/',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Login was not successful

invalidLogin: function () {

 

},

// Object not found for this Id.

notFound: function () {

 

},

// Attempted to update Object properties which are not allowed to be updated.

invalidField: function () {

 

},

// Object Id must be provided as `objectId` or in `objectData` hash.

objectIdMissing: function () {

 

},

// Required field missing

requiredFieldMissing: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

email required

Email address used to login to your salseforce account.

'user@gmail.com'
password required

Password used to login to your salseforce account.

'demo1234'
token required

If you do not have one, visit salseforce at My settings > personal > Reset My Security Token.

'x1x2x3'
objectType required

Salseforce object type.

'Lead'
objectData required

Object with updated properties. Must contain Id

{}
url

URL for connecting your salesforce instance, sandbox, etc.

'https://cs2.salesforce.com/'

Exits

error

An unexpected error occurred.

invalidLogin

Login was not successful

notFound

Object not found for this Id.

invalidField

Attempted to update Object properties which are not allowed to be updated.

objectIdMissing

Object Id must be provided as `objectId` or in `objectData` hash.

requiredFieldMissing

Required field missing

success

OK.