Stwissel / node-red-contrib-salesforce

A set of Node-RED nodes to interact with Salesforce and Force.com
MIT License
10 stars 17 forks source link

Salesforce insert ID not returned #61

Open habl opened 1 year ago

habl commented 1 year ago

Hello,

When inserting a new record in Salesforce, the ID isn't returned, it just returns as undefined. I tried creating a pull request with a fix bit doesn't seem to be allowed (I'm not used to github so might just be a failure on my end).

Anyway, adding this to dml.js on line 49 should fix it.

          // sometimes sfdcResult is a string instead of json object, so parse it
          if (typeof sfdcResult == 'string') {
            try {
              parsedSfdcResult = JSON.parse(sfdcResult);
              sfdcResult = parsedSfdcResult;
            } catch (error) {
            }
          }
Stwissel commented 1 year ago

@habl You would fork the project and create the PR from your fork. SHould do