Closed dwindibank closed 1 year ago
@dwindibank @Stwissel did you found a workaround for that issue yet? I could fork and fix it with a check for null value, but I'm not really setup to debug any of that as I'm more on the Salesforce side and helping a collegue with the communication between node red and us.
@darkjacko, sorry for not responding sooner. I patched the util.js class with the fix from the source library (nforce). I plan to consolidate the changes to the util.js file from the nforce library into the nforce8 library and post it as a pull request to nforce8.
There are some other improvements in that file but the main fix is updating the "isJsonRespone" function to not require that the content-type header is in the response.
This is what the changed function looks like:
util.isJsonResponse = function(res) {
return res.headers &&
res.headers['content-type'] &&
res.headers['content-type'].split(';')[0].toLowerCase() === 'application/json';
};
Ah, I spoke too soon. It was an easy fix but to get past the isJsonRespone issue, but much of the code in node-red-contrib-salesforce expects the payload to be Json.
So, now I'm getting the following error from line 22 of the SOQL node:
TypeError: Cannot create property 'records' on string {"totalSize":11,"done":true,"records":[{"attributes":{"type":"Contact","url":"/services/data/v41.0/sobjects/Contact/...
@dwindibank - you can throw what you have over the fence and I'll finish it up
I'm having this issue as well. In my situation, I'm updating an existing record (so I know the id) successfully and receiving the following 204 No Content response:
HTTP/1.1 204 No Content
Node Red is apparently not recognizing the 204 as a successful response and attempting to parse the
I was handling this by Catching the error. That isn't going to work if I have more than one update in a flow. We really need Node Red to recognize and accept a 204 response as successful without generating a subsequent error.
Has anyone found a nice way of suppressing this error?
Hi - Does anyone know when this might be fixed? or is addressed in node-red-contrib-c1-salesforce[5] ?
fixed in 0.8
The workflow I am using worked on the version 0.2.6, but on 0.7.2 it raises an error.
The error is caught by the NodeRed debug node. The DML statement I am executing looks like this (I am trying to update the account):
The update works fine, but the following error is raised:
That line of code is doing callin toLowerCase on the content-type header ... the original nforce library a check in that function to make sure the content-type header isn't null.
Notes: