+ Start a Discussion
AravindAravind 

insert record using soql

Hi All,
 
How to insert a record to custom object using soql query object from the API.
 
Thanks in advance.
Aravind
SuperfellSuperfell
You can't. You need to call the create operation, see the quickstarts and/or the docs.
AravindAravind
Thanks a lot. After posting the question i solved by using dynabean and create operation.
 
Thanks
Aravind
crocodilecrocodile
Hi Aravind-
Even i am facing the same problem to insert a record to custom object using soql query object from the API. Can you please guide me how to do this. Also provide some resources to get familiar with create operations

Thanks,
-Vissu
Chiyaan AnanthChiyaan Ananth

I have the same requirement to insert records to custom object from the API.  Any suggestions or ideas on how to do this?

 

Thanks,
Ananth Chellathurai

SuperfellSuperfell
see the create call in the enterprise/partner API.
Chiyaan AnanthChiyaan Ananth

The create call in the enterprise api has solutions and guideliness for standard objects.  I am looking to create records for an already created custom object.  I have created a cutom object called Result,  now I want to insert records of the object result.

 

I am able to create them through my salesforce account,  I need to do it from the webservice API.  Can you guide me where can I get a clue of doing this. 

SuperfellSuperfell
create works the same way for all sobject types, including custom objects.
Chiyaan AnanthChiyaan Ananth

Dear Simon,

 

For all standard objects I have the client code generated.  How do I get the java code for my custom object with all the cutom fields.  Can you please help me on how to get the client code for my custom object.  Should I have to regenerate it from my wsdl?  Or should I have to write my own java class?

 

Is there any sample code to insert records for custom object?  So that I can have it for my reference.

 

Thanks in Advance. 

SuperfellSuperfell
Download a current enterprise WSDL, it'll have all your customizations in it. see the getting started guide in the api docs.
Chiyaan AnanthChiyaan Ananth

Thanks a lot simon.  I think I am close enough to the solution.  I have dowloaded my wsdl before I have created my custom object.  I will download the latest wsdl and regenerate my client classes.

 

Thank you.

 

cheers

Ananth 

crocodilecrocodile

Hi Ananth,

                if you are able to insert records using triggers an dclasses in your custom object...

           1. Generate Enterprise/Partner WSDL for the class and save it on local system

           2. Using WSDL2JAVA tool create java API for the WSDL. this can be done using Apache axis 

           3. Use this API in your java classes to insert records from java console

For clear information follow quick start at http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_quickstart_steps.htm 

 

 

-Vissu

Siva SirivuriSiva Sirivuri
Hi Aravind,

Can you please post some sample code which generates custom object Java classes, Saleforce generated Java claasses has lot of members(default and custom fields),are you generating similar class, these class extends SObject,is this supported by DynaBean.

Thanks in Advance.