Salesforce.createObject()

Create a salseforce object given object properties. Returns new object Id

Requires authentication with username, password, and secret token.

Usage

Hover over inputs/exits for more info.

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


// Create a salseforce object given object properties. Returns new object Id

Salesforce.createObject({

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 () {

 

},

// Required field missing

requiredFieldMissing: function () {

 

},

// OK.

success: function (result) {

 

},

});

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 new properties. If Id is present it will be deleted.

{}
url

URL for connecting your salesforce instance, sandbox, etc.

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

Exits

error

An unexpected error occurred.

invalidLogin

Login was not successful

requiredFieldMissing

Required field missing

success

OK.

'00Q5000000yzUmOEAU'