You need to sign in to do that
Don't have an account?
rishi jaykar 1
how to insert record using tooling API:
final PageReference theUrl = new PageReference(SERVER_URL + '/services/data/v37.0/query/');
for Example i am using this code for getting record now i want to insert record using same technic ??:
theUrl.getParameters().put('q','select id,name from Account limit 10');
request = new HttpRequest();
request.setEndpoint(theUrl.getUrl());
request.setMethod('GET');
request.setHeader('Authorization', 'OAuth ' + SESSION_ID);
String body = (new Http()).send(request).getBody();
System.debug('Accounts in JSON format: ' + body);
for Example i am using this code for getting record now i want to insert record using same technic ??:
theUrl.getParameters().put('q','select id,name from Account limit 10');
request = new HttpRequest();
request.setEndpoint(theUrl.getUrl());
request.setMethod('GET');
request.setHeader('Authorization', 'OAuth ' + SESSION_ID);
String body = (new Http()).send(request).getBody();
System.debug('Accounts in JSON format: ' + body);
May I suggest you please check the below link for reference.
- https://salesforce.stackexchange.com/questions/92987/possible-to-create-a-new-sobject-with-tooling-api-rest-interface
hope it helps.Please mark it as best answer if the information is informative.
Thanks
Rahul Kumar
http://www.alwaysreview.net/reviews/sky-customer-services/