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
PhantomLordPhantomLord 

sObject.setField method does not exist in Partner WDSL

Hi guys,

 

I am starting with the SOAP API for Salesforce, and I have the following problem.

 

On this page I can see that there must be a setField method in sObject:

 

SObject account = new com.sforce.soap.partner.sobject.wsc.SObject();
account.setType("Account");
account.setField("Name","myAccount");
account.setField("XID1__c", "1");

 

But I don't see it in the Partner WDSL that I get in App Setup > API > Partner WDSL.

 

<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:sobject.partner.soap.sforce.com">
<import namespace="urn:partner.soap.sforce.com"/>
<!--  Dynamic sObject  -->
<complexType name="sObject">
<sequence>
<element name="type" type="xsd:string"/>
<element name="fieldsToNull" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<element name="Id" type="tns:ID" nillable="true"/>
<any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
</sequence>
</complexType>
</schema>

According to google, I am the only one who has this problem. Is there any chance that I do something wrong when I get the WSDL?

Best Answer chosen by Admin (Salesforce Developers) 
PhantomLordPhantomLord
SimonF, thank you for your reply.
I just stopped after seeing no getField method or Field property,while I should have just read the documentation further. I found a sample here:
http://www.salesforce.com/us/developer/docs/api/Content/sample_create_call.htm :)

All Answers

SuperfellSuperfell

setField is part of the java API that WSC generates from the WSDL, its not from anything in the WSDL itself.

 

Perhaps you can back-up a step and describe the actual problem you're having.

PhantomLordPhantomLord

Basically I want to create an object, like an Account, Lead or a Contact, and fill it with data, or get an existing object and update it. Right now I don't see how I could do it, because I don't get access to any fields. My goal is to be able to read/write fields using the Partner WSDL.

BTW, I am using C# and VS2010, not Java.

PhantomLordPhantomLord
SimonF, thank you for your reply.
I just stopped after seeing no getField method or Field property,while I should have just read the documentation further. I found a sample here:
http://www.salesforce.com/us/developer/docs/api/Content/sample_create_call.htm :)
This was selected as the best answer
ApoorvApoorv

Hi Phantom,

 

Can you please tell how you achieved to solve that issue? I am integrating through iphone and not able to find the setField method for sObject.

Please help.