Giter Site home page Giter Site logo

node-salesforce's Introduction

node-salesforce's People

Contributors

bojand avatar nateferrero avatar stemail23 avatar stomita avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-salesforce's Issues

Bulkify

Is there a way to implement the bulk rest api in order to make CRUD operations in Bulk?

TypeError: Object #<Object> has no method 'split'

Idea?

$ sfjs

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'split'
at Interface.setPrompt (readline.js:121:24)
at new REPLServer (repl.js:128:7)
at Object.start (repl.js:251:14)
at Object.start (/usr/local/lib/node_modules/node-salesforce/lib/repl.js:88:35)
at Object. (/usr/local/lib/node_modules/node-salesforce/bin/sfjs:4:14)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:32)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)

Npm install node-salesforce not working

Getting the error:

gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_module
s\npm\node_modules\node-gyp\lib\configure.js:424:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu
les\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\YouConnected
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm http 304 https://registry.npmjs.org/websocket-driver
npm ERR! not ok code 0

on doing npm install. Node version is mentioned in the error.

Errors in callbacks are not thrown

Errors in callbacks are not thrown. Normally we expect errors in callbacks not be swallowed by Promise chain.

connection.sfobject('Account').create(account,function(err,result){
  throw new Error('This error will be suppressed')
})

In addition, the Promise implementation breaks normal error handling expectations.

connection.sfobject('Account').create(account).then(function(){
  throw new Error('This error will be suppressed as expected')
}).catch(function(e){
  console.error('But this will never be seen.')
})

Using the .done function does work as expected.

connection.sfobject('Account').create(account).done(function(){
  throw new Error('This error will be thrown as usual')
},function(sfError){
  //handle error from salesforce
})

Issues with "Connection queryMore"

The various different flavours of using nextRecordsUrl for large queries seem to be broken, as they call the Query constructor with a null config parameter which barfs on "this.select(config.fields);"

I'm trying to find a work around. Any thoughts?

Cannot read property 'async' of undefined

Hello,

I have installed node-salesforce, but when I try to load the package I get the following error:

> require('node-salesforce')
TypeError: Cannot read property 'async' of undefined
    at /Users/raphael/nodejs-doctrine/node_modules/node-salesforce/node_modules/async/lib/async.js:8:30
    at Object.<anonymous> (/Users/raphael/nodejs-doctrine/node_modules/node-salesforce/node_modules/async/lib/async.js:692:2)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/raphael/nodejs-doctrine/node_modules/node-salesforce/node_modules/async/index.js:3:18)
    at Module._compile (module.js:409:26)
> 

Cannot logout using instance url and access token

Hey, great work on the Salesforce-node.js integration. I am loving it. I am logging in the node.js site using standard login page with salesforce credentials. It returns the instance url and access token which is saved in my session.

However, in the docs, it is mentioned that we can only log out using session Id and server url. Can I not log out using the instance url and access token? I tried doing that but it threw an error.

is $exists in sql-builder correct?

case "EXISTS":
      return [ field, value ? "=" : "!=", "null" ].join(" ");

This doesn't seem to work...
shouldn't it be something like:

return [ field, value ? "!=" : "==", "null" ].join(" ");?
if value is true (ie. $exists: true) check against != null otherwise check == null?

Maybe I am not using it correctly, but I have for example:

AccountId: { $exists: true }

and it doesn't work when I would expect object to be returned. If I set it to false it does work.

Api for live chat

Hello, @stomita tanks for this library. I have the question: chat in sales forces can integrate in API for developing?

Chatter

Can anyone advise how to add Chatter functionality?

couldn't update case ownerid because of auto assign rule

I was trying to update/create a case but ownerid was overwritten by the auto assign rule.
I added Sforce-Auto-Assign to FALSE in the header and seems to resolve this issue.

connection.js
 482 Connection.prototype.create = function(type, records, callback) {
 483   if (arguments.length === 2) {

 510         headers : {
 511           "Content-Type" : "application/json",
 512           'Sforce-Auto-Assign': 'FALSE'
 513         }
}

Error install with npm

Hi ,
I got this error when trying to install with npm 1.3.14 + node 0.10.22 + Win7 :
"...

1372 verbose false,C:\node\myapp\node_modules,C:\node\myapp\node_modules\node-salesforce\node_modules unbuild [email protected]
1373 info postuninstall [email protected]
1374 verbose about to build C:\node\myapp\node_modules\node-salesforce
1375 info C:\node\myapp\node_modules\node-salesforce unbuild
1376 info preuninstall [email protected]
1377 info uninstall [email protected]
1378 verbose true,C:\node\myapp\node_modules,C:\node\myapp\node_modules unbuild [email protected]
1379 verbose C:\node\myapp\node_modules.bin,[object Object] binRoot
1380 info postuninstall [email protected]
1381 error [email protected] install: node-gyp rebuild
1381 error Exit status 1
1382 error Failed at the [email protected] install script.
1382 error This is most likely a problem with the node-expat package,
1382 error not with npm itself.
1382 error Tell the author that this fails on your system:
1382 error node-gyp rebuild
1382 error You can get their info via:
1382 error npm owner ls node-expat
1382 error There is likely additional logging output above.
1383 error System Windows_NT 6.1.7601
1384 error command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "node-salesforce"
1385 error cwd C:\node\myapp
1386 error node -v v0.10.22
1387 error npm -v 1.3.14
1388 error code ELIFECYCLE
1389 verbose exit [ 1, true ]
"

TX.

Syntax Help

Need some help in querying records with LookUp fields and Child objects. How should one write the column names in Method Chaining

Please add a generic way to call the SOAP API.

This would be great if you could make a small enhancement to support custom build SOAP API Call. It's not about building the whole stuff by parsing the wsdl but rather this could be cool in a first step just to call a method like .genericSOAP to which we give the full SOAP request.

and then you build the http request, send the request, get the result and send it to a callback function. This would have also to support if the access token is still valid - and if not refreshing it. Actually this shouldn't be far away from the soap login / logout method you have already written, just more generic.

The point is that the REST API is cool but limited while the SOAP API is weird but offers lots of possibilities - and building ourself the request might be not that nice but it's still pretty easy.

Salesforce Password Expiry

Hello team,

With subsequent saleforce releases. The password seems to expire after every 3 months.

How can it be handled in the system?

Getting "Description", "Required" fields

Hello @stomita,

First, thanks for this Node.js package. I'd like to get the Description and Required value of a particular field. If I do as followed in the documentation:

conn.sobject('Account').describe(function(err, meta) {
  if (err) { return console.error(err); }
  console.log(meta.fields);
});

I noticed that each field describe doesn't contain the description and required keys (and also a couple other keys available there http://www.salesforce.com/us/developer/docs/api_meta/Content/customfield.htm).

Is there a way to get them using the package or something to fix in my request?

Thanks.

Unwanted files in your NPM package

Hey, I invite you to update your NPM package. I think it contains some unwanted files that you may not want to share, like test.sh, pipeline.sh, migration.sh and also y our project folder .sublime. Some may contain sensible information.

Queries eventually always timeout.

I have been using node-salesforce to be the glue between our salesforce data and separate services. Problem I find is that after a while, a few hours, it seems like every request I attempt with SObject#find(conditions, fields) just never returns.

I have put in code for this to detect if the query has persisted for too long and attempt retrying the query. This seems to work till it it simply "timesout" over and over and over again.

I'd like to say this is an error in the way I am using the API. I see that the build is currently "failing." Are there any flags I can switch on in the API that enables some verbose logs that could be useful to diagnose the potential issue?

Metadata deployment

Hi,

I am trying to deploy some custom object and fields from one organization into another. Is it possible to achieve this with this client?

npm install error on centos

Any ideas why it occured? Thanks.

[email protected] install /var/releases/20130823215226/node_modules/node-salesforce/node_modules/xml2json/node_modules/node-expat
node-gyp rebuild

make: Entering directory /var//releases/20130823215226/node_modules/node-salesforce/node_modules/xml2json/node_modules/node-expat/build' CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlparse.o make: cc: Command not found make: *** [Release/obj.target/expat/deps/libexpat/lib/xmlparse.o] Error 127 make: Leaving directory/var/releases/20130823215226/node_modules/node-salesforce/node_modules/xml2json/node_modules/node-expat/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/packages/encap/node-v0.10.15/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 2.6.18-238.el5
gyp ERR! command "node" "/packages/encap/node-v0.10.15/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/releases/20130823215226/node_modules/node-salesforce/node_modules/xml2json/node_modules/node-expat
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

Cannot Refresh Token

Hi all, I am attempting to refresh my accessToken using a refresh token, I've attempted to follow the docs but the connection is failing silently and the refresh event is never triggered. All of the parameters are valid as far as I can tell. Regular authentication seems to be working fine.

var oauthParams = {
    clientId: 'xxx',
    clientSecret: 'xxx',
    redirectUri: 'xxx'
};

function refreshAuth(refreshToken, accessToken) {

    var deferred = Q.defer();

    // console.log('creating connection with:', oauthParams);
    conn = new sf.Connection({
        oauth2: oauthParams,
        instanceUrl: 'https://na15.salesforce.com',
        accessToken: accessToken,
        refreshToken: refreshToken
    });

    conn.on('refresh', function(accessToken, res) {
        console.log('refresh complete:', accessToken);
        deferred.resolve(accessToken);
    }, function(err) {
        console.log('hidden err:', err);
    });

    return deferred.promise;
}

Update Document

var body = { title: 'hello', num : 1 };
conn.apex.post("/MyTestApexRest/", body, function(res) {
  // the response object structure depends on the definition of apex class 
});

This code should be

var body = { title: 'hello', num : 1 };
conn.apex.post("/MyTestApexRest/", body, function(err, res) {
  // the response object structure depends on the definition of apex class 
});

Please update this on NPM page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.