You need to sign in to do that
Don't have an account?
Abhijit Shrikhande 10
Tooling API - Outdated Documentation?
I am looking at the Tooling API for an example on how to create a class. I took a a look at this example and I suspect this documentation is outdated.
https://developer.salesforce.com/docs/atlas.en-us.198.0.api_tooling.meta/api_tooling/intro_soap_overview.htm
If you read the page it says "These Examples use java". This is incorrect. Console.WriteLine is not present in Java. It is a feature of C#.
When you attempt to compile this code, there are further errors.
Is there a specific example on how to use tooling API?
https://developer.salesforce.com/docs/atlas.en-us.198.0.api_tooling.meta/api_tooling/intro_soap_overview.htm
If you read the page it says "These Examples use java". This is incorrect. Console.WriteLine is not present in Java. It is a feature of C#.
When you attempt to compile this code, there are further errors.
String classBody = "public class Messages {\n" + "public string SayHello() {\n" + " return 'Hello';\n" + "}\n" + "}"; // create an ApexClass object and set the body ApexClass apexClass = new ApexClass(); apexClass.Body = classBody; ApexClass[] classes = { apexClass }; // call create() to add the class SaveResult[] saveResults = sforce.create(classes); for (int i = 0; i < saveResults.Length; i++) { if (saveResults[i].success) { Console.WriteLine("Successfully created Class: " + saveResults[i].id); } else { Console.WriteLine("Error: could not create Class "); Console.WriteLine(" The error reported was: " + saveResults[i].errors[0].message + "\n"); } }
Is there a specific example on how to use tooling API?
[1] https://jsforce.github.io/document/#tooling-api
[2] https://twitter.com/salesforcedocs
Another resource which has helped quite a bit in the past is poking around with the REST explorer on workbench (workbench.developerforce.com). From there, you can explore the various Tooling API operations and how to request and handle the responses.
Other than those few things, there's really not much out there when it comes to the Tooling API.
{ JSON_PARSER_ERROR: Cannot deserialize instance of string from START_ARRAY value [line:1, column:21]
at HttpApi.getError (D:\Zagalabs\Cipress Hill\SFIntegration\node_modules\jsforce\lib\http-api.js:250:13)
at D:\SFIntegration\node_modules\jsforce\lib\http-api.js:95:22
at tryCallOne (D:\SFIntegration\node_modules\promise\lib\core.js:37:12)
at D:\SFIntegration\node_modules\promise\lib\core.js:123:15
at flush (D:\SFIntegration\node_modules\asap\raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9) name: 'JSON_PARSER_ERROR', errorCode: 'JSON_PARSER_ERROR' }
the problem is that i'm using the last version and in the documentation there are not information about this error. My code is this one:
conn.sobject('Lead').create({
FirstName : excelData[j]['First Name'],
LastName : ['Last Name'],
Company : company,
Email : excelData[j].Email,
Phone : excelData[j]['Phone 1'],
Address : parseString(excelData[j]['Service address']),
BillingCity__c : excelData[j]['City'],
BillingPostalCode__c : excelData[j]['ZIP']},function(err,ret){
if (err) { return console.error(err); }
console.log(ret.id);
});
What I'm doing wrong?
Thanks
My guess is that you need "excelData[j]['Last Name'] on line 3 (of the code above) to fix this issue.
Error: Exceeded max limit of concurrent call
at Connection.insert.Connection.create (D:\Zagalabs\Cipress Hill\SFIntegration\node_modules\jsforce\lib\connection.js:619:27)
at SObject.insert.SObject.create (D:\Zagalabs\Cipress Hill\SFIntegration\node_modules\jsforce\lib\sobject.js:62:21)
at compareData (D:\Zagalabs\Cipress Hill\SFIntegration\fileManager.js:49:42)
at D:\Zagalabs\Cipress Hill\SFIntegration\fileManager.js:16:13
at promiseCallback (D:\Zagalabs\Cipress Hill\SFIntegration\node_modules\jsforce\lib\query.js:334:15)
at .<anonymous> (D:\Zagalabs\Cipress Hill\SFIntegration\node_modules\jsforce\lib\query.js:347:5)
at g (events.js:291:16)
at emitTwo (events.js:106:13)
at emit (events.js:191:7)
at D:\Zagalabs\Cipress Hill\SFIntegration\node_modules\jsforce\lib\query.js:431:12
that means that i can't do recurrent insert to the API? i'm only sending five or six records,
thanks a lot!