Jsforce: Tooling API - Can't create objects

Created on 2 Dec 2018  路  3Comments  路  Source: jsforce/jsforce

When I try to create an object such as 'ApexClass', I get the following error:

TypeError: this._createSingle is not a function
At: at Tooling.Connection.insert.Connection.create

This is the code:
conn.login(username, password + securityToken, function(err) { if (!err) { const apexBody = [ "public class TestApex {", " public string sayHello() {", " return 'Hello';", " }", "}"].join('\n'); conn.tooling.sobject('ApexClass').create({ body: apexBody }, function(err, res) { if (err) { return console.error(err); } console.log(res); }); } });

Most helpful comment

I had the same issue with JSforce v 1.9.1. I downgraded to 1.8.5 and was able to use the Tooling API as expected.

All 3 comments

I had the same issue with JSforce v 1.9.1. I downgraded to 1.8.5 and was able to use the Tooling API as expected.

I got a similar error this._ensureVersion is not a function and downgrading solved it as well

Upgrading to 1.9.3 will be a better move, as dated now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jbonigomes picture jbonigomes  路  3Comments

fearphage picture fearphage  路  4Comments

JonDum picture JonDum  路  7Comments

shomanishikawa picture shomanishikawa  路  7Comments

freshlogic picture freshlogic  路  8Comments