• Sarvesh Sharma
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
is it possible to upsert the AccountId field of an salesforce Contact. using the salesforce apis
when i try this i am getting the following error 

A fault is received in a upsert request.  Fault code [{http://schemas.xmlsoap.org/soap/envelope/}Client].  Fault subcode [{http://schemas.xmlsoap.org/soap/envelope/}Client].  Reason [Unexpected element {urn:sobject.partner.soap.sforce.com}type during simple type deserialization].  Detail [Unexpected element {urn:sobject.partner.soap.sforce.com}type during simple type deserialization].
2015-07-21 15:04:30 [INFO] Failed to insert the record [001i000000iU8hAAAS,Update_Test] because of the following error: [Unexpected element {urn:sobject.partner.soap.sforce.com}type during simple type deserialization].

Thanks in advance!!!!!!!!
I am trying to write a grammar for parsing a SOQL query and while doing that I faced a problem where I need to find the maximum number of Aggregate functions (SUM (FieldName), COUNT (FieldName),... etc.) can be used in a single select clause of a SOQL query. Any help we appreciated. Thanks in advance!!!!!!
i am trying to extract out the field names from the QueryResult object returned by executing partnerCOnnection.query(). I know it returns an array of SObjects. 
 Now if i enter a query as followed:-

SELECT Contact.LastName ,Contact.FirstName ,Contact.Account.BillingStreet ,Contact.Account.BillingCity ,Contact.Account.BillingState ,Contact.Account.CreatedBy.Country ,Contact.Account.CreatedBy.Latitude ,Contact.Account.CreatedBy.Longitude ,Contact.Account.CreatedBy.Email FROM Contact LIMIT 1


  The sObjects[] returned is:-


[XmlObject{name={urn:partner.soap.sforce.com}records, value=null, children=[XmlObject{name={urn:sobject.partner.soap.sforce.com}type, value=Contact, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Id, value=null, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}LastName, value=YKJ01-0004, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}FirstName, value=null, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Account, value=null, children=[]}]}]
 
i.e. it just returns the filed values of Contact object. it does not give any information about the other related objects(Account and User) .

but now if i remove the LIMIT 1 it returns a sobject[] as follows:-

[XmlObject{name={urn:partner.soap.sforce.com}records, value=null, children=[XmlObject{name={urn:sobject.partner.soap.sforce.com}type, value=Contact, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Id, value=null, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}LastName, value=Gonzalez, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}FirstName, value=Rose, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Account, value=null, children=[XmlObject{name={urn:sobject.partner.soap.sforce.com}type, value=Account, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Id, value=null, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}BillingStreet, value=312 Constitution Place
Austin, TX 78767
USA, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}BillingCity, value=Austin, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}BillingState, value=TX, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}CreatedBy, value=null, children=[XmlObject{name={urn:sobject.partner.soap.sforce.com}type, value=User, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Id, value=null, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Country, value=IN, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Latitude, value=null, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Longitude, value=null, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Email, value=sasharma@informatica.com, children=[]}]}]}]}, XmlObject{name={urn:partner.soap.sforce.com}records, value=null, children=[XmlObject{name={urn:sobject.partner.soap.sforce.com}type, value=Contact, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Id, value=null, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}LastName, value=Forbes, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}FirstName, value=Sean, children=[]}, XmlObject{name={urn:sobject.partner.soap.sforce.com}Account, value=null, 

basically it contains all the information of all the objects fields.

SO i want to understand how is the sObject array is formed . can anyone explain it with an example(preferrably with relationship in the query)

thanks in advance!!!!!!!!!
I am trying to write a grammar for parsing a SOQL query and while doing that I faced a problem where I need to find the maximum number of Aggregate functions (SUM (FieldName), COUNT (FieldName),... etc.) can be used in a single select clause of a SOQL query. Any help we appreciated. Thanks in advance!!!!!!