Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 5 additions & 2 deletions soql.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ 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...."});

// 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
Expand All @@ -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.query({ query: config.query })
return org.query({ query: query })
}).then(function(results) {
msg.payload = {
size: results.totalSize,
Expand Down
7 changes: 5 additions & 2 deletions sosl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ 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...."});

// 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
Expand All @@ -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,
Expand Down