Skip to main content
Hello,

I'm using jsforce to update the Account object in salesforce.

And I've tried various configurations based on this thread:

I pretty much get the same results as described by Daniel Ballinger. However I can't put the address attributes directly on the Account either: 

 

conn.sobject("Account").create({

"Name" : org.info.name,

//"Owner" : 'Michael Hedrick',

"Phone": org.contact.telephone,

"POC_First_Name__c" : org.contact.name.first,

"POC_Last_Name__c" : org.contact.name.last,

"Street": org.address.address1,

"City": org.address.city,

"state": org.address.state,

"PostalCode": org.address.zipcode,

"Country": org.address.country,

"Email2__c" : org.contact.email

}, function(err, res) {

if (err || !res.success) { return winston.error(err, res); }

winston.info('Account created on salesforce. id:', res.id);

});

The above fails with the error:  { [INVALID_FIELD: No such column 'Street' on sobject of type Account] name: 'INVALID_FIELD', errorCode: 'INVALID_FIELD' } undefined

I've also tried:

 

conn.sobject("Account").create({

"Name" : org.info.name,

//"Owner" : 'Michael Hedrick',

"Phone": org.contact.telephone,

"POC_First_Name__c" : org.contact.name.first,

"POC_Last_Name__c" : org.contact.name.last,

"ShippingAddress" : {

"street": org.address.address1,

"city": org.address.city,

"state": org.address.state,

"postalCode": org.address.zipcode,

"country": org.address.country

},

"Email2__c" : org.contact.email

}, function(err, res) {

which gives the error :

{ [INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: ShippingAddress. Please check the security settings of this field and verify that it is read/write for your profile or permission set.]

  name: 'INVALID_FIELD_FOR_INSERT_UPDATE',

  errorCode: 'INVALID_FIELD_FOR_INSERT_UPDATE',

  fields: [ 'ShippingAddress' ] }

What do I need to do to get the shipping address populated correctly.

Thanks,

 
1 answer
  1. Apr 13, 2016, 9:52 PM

    I figured it out.

    Was able to see on workbench.developerforce.com that the entity names are actually ShippingStreet, ShippingPostalCode, etc. The fields are on the account object itself but they are prefixed with the the word 'Shipping'.

    The below works:

    conn.sobject("Account").create({

    "Name" : org.info.name,

    //"Owner" : 'Michael Hedrick',

    "Phone": org.contact.telephone,

    "POC_First_Name__c" : org.contact.name.first,

    "POC_Last_Name__c" : org.contact.name.last,

    "ShippingStreet": org.address.address1,

    "ShippingCity": org.address.city,

    "ShippingState": org.address.state,

    "ShippingPostalCode": org.address.zipcode,

    "ShippingCountry": org.address.country,

    "Email2__c" : org.contact.email

    }, function(err, res) {

0/9000