Good afternoon. The following code returns a weird error. I've looked at https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_attachment.html as a guide and from what I can tell, all of my settings are configured appropriately. Any reason why it's returning a weird error? usually it references a line in my code that returns the error but for some reason it does not. Is this because the error does not occur within my code?
var jsforce = require('jsforce');
var conn = new jsforce.Connection();
const fs = require('fs')
require('dotenv').config()
user = process.env.USER
pass = process.env.PASS
conn.login(user, pass, function(err, res) {
if (err) { return console.error(err); }
fs.readFile('2d.png',function(err, image){
if(err){return console.log(err)}
base64data = new Buffer.from(image, 'base64')
conn.sobject('Attachment').create({
ParentId: 'a7L3o000002J0YW',
Name: '2d.png',
Body: base64data
}, function(err,res){
if(err){return console.log(err)}
console.log(res)
})
})
})
Error:
INVALID_FIELD: No such column 'type' on sobject of type Attachment
at HttpApi.getError (C:\Users\paulp\Desktop\Projects\JSForce Playground\node_modules\jsforce\lib\http-api.js:250:13)
at C:\Users\paulp\Desktop\Projects\JSForce Playground\node_modules\jsforce\lib\http-api.js:95:22
at tryCallOne (C:\Users\paulp\Desktop\Projects\JSForce Playground\node_modules\promise\lib\core.js:37:12)
at C:\Users\paulp\Desktop\Projects\JSForce Playground\node_modules\promise\lib\core.js:123:15
at flush (C:\Users\paulp\Desktop\Projects\JSForce Playground\node_modules\asap\raw.js:50:29)
at processTicksAndRejections (internal/process/task_queues.js:79:11) {
name: 'INVALID_FIELD',
errorCode: 'INVALID_FIELD'
}