Tooling API - Can't create objects
See original GitHub issueWhen 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); }); } });
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Can not create Trigger for Custom Object with Tooling Api
I need to write logic for creating triggers for Standard and Custom Objects. It works for Standard Objects. However when I try to...
Read more >(Tooling Api) Can i create custom field on ApexClass object
In short No, you can't create custom fields via Apex as they are Metadata. However ,there is a workaround which was created by...
Read more >Tooling API - Salesforce Implementation guides
Use Tooling API to build custom development tools or apps for Lightning Platform applications. Tooling API's SOQL capabilities for many.
Read more >Tooling API to Retrieve Metadata dependency for ... - YouTube
Tooling API to Retrieve Metadata dependency for Custom objects.This video is in continuation of the below ...
Read more >Variable does not exist: Contact: Source error on LWC Tooling ...
The CLI does not use the Tooling API which is why you don't see this issue via the CLI. As a workaround, you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.
Can confirm that this is still an issue in 2.0.0-beta.19. Unable to use the Tooling API functionality for DML operations, throws the error
TypeError: this._ensureVersion is not a function
.