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
Daniel ThomsonDaniel Thomson 

how and when to use the SOAP API classses...........

hiii.............

 

I am working on website integration with salesforce using SOAP API and converted the enterprise.wsdl file into enterprise.jar file which is having many classes..... How and where to use these classes I dont know can any one help me regarding that..........

 

 

Thanks in advance.........

Best Answer chosen by Admin (Salesforce Developers) 
AshanAshan

You cant update a single object. Put the object in to a array and update it.

Example:

String quaryString="SELECT id,name FROM Account WHERE id='001900000072lps'";
              QueryResult result = connection.query(quaryString);
             
              SObject[] results= result.getRecords();
              for (int i = 0; i < results.length; i++) {
                  Account acc = (Account)results[i];
                  acc.setName("Change Through API");
                 
            }
             
              connection.update(results);

All Answers

AshanAshan

Try to get help from this.

http://wiki.developerforce.com/index.php/Introduction_to_the_Force.com_Web_Services_Connector

Dont forget to concat the security token to the password.

If you need ask for more help

 

Daniel ThomsonDaniel Thomson

I have already used that link to create SOAP API but I want help regarding it classes actually i want to set the goal for particular account but I am unable to do that.......

 

 

so can u helpp me regarding that................

AshanAshan

I'm not sure about what you mean by setting a goal to an Account.

But you can

quary for you specific Account and do any changes to it an then update it using

connection.update(selectedAccount);



Daniel ThomsonDaniel Thomson

Actually I want I am having Goal__c custom object and there are some field related to that like

 

ID

GOAL_END_YEAR__C

GOAL_START_YEAR__C

PRIORITY__C

INFLATION_RATE__C

now I want to insert some values from my website into these custom objects for a particular account..................

 

How can i do that????????????????

 

Thanks for replies........



SuperfellSuperfell

Checkout the getting started section in the API docs http://www.salesforce.com/us/developer/docs/api/index.htm

AshanAshan

Can you specifically say where you are having the problem. Is it with the connection, Quering of updating?

Daniel ThomsonDaniel Thomson

updating..............

AshanAshan

You cant update a single object. Put the object in to a array and update it.

Example:

String quaryString="SELECT id,name FROM Account WHERE id='001900000072lps'";
              QueryResult result = connection.query(quaryString);
             
              SObject[] results= result.getRecords();
              for (int i = 0; i < results.length; i++) {
                  Account acc = (Account)results[i];
                  acc.setName("Change Through API");
                 
            }
             
              connection.update(results);

This was selected as the best answer
Daniel ThomsonDaniel Thomson

thanks.............