function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jwillansjwillans 

Creating data using partner API

It is possible using the enterprise API to create data using the approach described here:

http://www.salesforce.com/us/developer/docs/api/index.htm

Is it possible to achieve the same end through the "partner" API. For example, rather than concrete Java types:

Opportunity newOpportunity = new Opportunity();
newOpportunity.setStageName("Prospecting");
SaveResult[] results = binding.create(new SObject[] {newOpportunity});

Can the description of object types be captured in data, for example:

SObject opportunity = new SObject();
sobject.setType("Opportunity");

/* Missing bit: some code to describe the stage name */

SaveResult[] results = binding.create(new SObject[] {newOpportunity});

Thanks,

James

Message Edited by jwillans on 08-08-200707:42 AM

SuperfellSuperfell
Yes, that's exactly how the partner WSDL works, see some of the partner sample code.
jwillansjwillans
Thanks Simon - I have figured it out.

James