From a3e8aaff79631702ff06261ff3a3d4d1717bef7a Mon Sep 17 00:00:00 2001 From: Ben Ariss Date: Thu, 30 Nov 2017 09:11:26 +0000 Subject: [PATCH 1/3] Incremented package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e5e8ba7..414fae8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-salesforce", - "version": "0.0.5", + "version": "0.0.6", "description": "A set of Node-RED nodes to interact with Salesforce and Force.com.", "author": { "name": "Jeff Douglas", From c64ede25ec718bcd08d102db68a4c7d3a87ae371 Mon Sep 17 00:00:00 2001 From: Ben Ariss Date: Mon, 4 Dec 2017 13:59:16 +0000 Subject: [PATCH 2/3] Fixed the SOQL and SOSL nodes to stop them caching the first query they are passed when the query is passed in the message rather than defined in the node. --- soql.js | 8 ++++++-- sosl.js | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/soql.js b/soql.js index 839d9bc..b198834 100644 --- a/soql.js +++ b/soql.js @@ -6,14 +6,18 @@ module.exports = function(RED) { RED.nodes.createNode(this,config); this.connection = RED.nodes.getNode(config.connection); var node = this; + var query = ''; this.on('input', function(msg) { // show initial status of progress node.status({fill:"green",shape:"ring",text:"connecting...."}); + this.log("config.query = " + config.query); // use msg query if node's query is blank if (msg.hasOwnProperty("query") && config.query === '') { - config.query = msg.query; + query = msg.query; + } else { + query = config.query; } // create connection object @@ -27,7 +31,7 @@ module.exports = function(RED) { // auth and run query org.authenticate({ username: this.connection.username, password: this.connection.password }).then(function(){ - return org.query({ query: config.query }) + return org.query({ query: query }) }).then(function(results) { msg.payload = { size: results.totalSize, diff --git a/sosl.js b/sosl.js index 309a6f3..be12127 100644 --- a/sosl.js +++ b/sosl.js @@ -6,6 +6,7 @@ module.exports = function(RED) { RED.nodes.createNode(this,config); this.connection = RED.nodes.getNode(config.connection); var node = this; + var query = ''; this.on('input', function(msg) { // show initial status of progress @@ -13,7 +14,9 @@ module.exports = function(RED) { // use msg query if node's query is blank if (msg.hasOwnProperty("query") && config.query === '') { - config.query = msg.query; + query = msg.query; + } else { + query = config.query; } // create connection object @@ -27,7 +30,7 @@ module.exports = function(RED) { // auth and run query org.authenticate({ username: this.connection.username, password: this.connection.password }).then(function(){ - return org.search({ search: config.query }) + return org.search({ search: query }) }).then(function(results) { msg.payload = { size: results.length, From 59b59b23a5dd3f48690a709197a126e742778602 Mon Sep 17 00:00:00 2001 From: Ben Ariss Date: Mon, 4 Dec 2017 14:06:36 +0000 Subject: [PATCH 3/3] Removed debug logging --- soql.js | 1 - 1 file changed, 1 deletion(-) diff --git a/soql.js b/soql.js index b198834..6963300 100644 --- a/soql.js +++ b/soql.js @@ -12,7 +12,6 @@ module.exports = function(RED) { // show initial status of progress node.status({fill:"green",shape:"ring",text:"connecting...."}); - this.log("config.query = " + config.query); // use msg query if node's query is blank if (msg.hasOwnProperty("query") && config.query === '') { query = msg.query;