+ Start a Discussion
SurpriseSurprise 

Query and Enterprise WSDL

Hi All,

 

I have salesforce to salesorce going on and I am trying to query an opportunity object and the end result says sucess.However,When  i try to see result in the logs I do not see result.For example,I am querying amount field on the opportunity object .

 

Is there something I am missing?

 

enterpriseSoapSforceCom.soap binding = new enterpriseSoapSforceCom.soap();
enterpriseSoapSforceCom.LoginResult lr = binding.login('james@yahoo.com','james123cjZCb80EPTaIce9SXTCRXpoHC');  
system.debug('The value in the lr of loginresult is'+lr);
//Update the binding endpoint as per the LoginResult
binding.endpoint_x = lr.ServerUrl;Spell Check
System.debug('The value after setting the binding of the binding.endpoint_x+'+binding.endpoint_x);
binding.SessionHeader = new enterpriseSoapSforceCom.SessionHeader_element();
binding.SessionHeader.sessionid=lr.sessionid;
System.debug('The value in variable of sesion id is'+binding.SessionHeader.sessionid);
string s='Select amount from opportunity limit 1';
enterpriseSoapSforceCom.QueryResult l = binding.query(s);
System.debug('The value in the variable l of type l is'+l);

sfdcfoxsfdcfox
This is Apex Code, I presume? You might not see an immediate result only because the log truncates really long toString() conversions. Try debugging a little closer to home, such as l.records instead of just l.
SurpriseSurprise

Yes that is from Apex to APex and now I have appended record with l and this what I see in the logs:-

 

The values in the variable l is(sObject_x:[Id=null, Id_type_info=(Id, urn:enterprise.soap.sforce.com, ID, 1, 1, true), apex_schema_type_info=(urn:sobject.enterprise.soap.sforce.com, true, false), field_order_type_info=(fieldsToNull, Id), fieldsToNull=null, fieldsToNull_type_info=(fieldsToNull, http://www.w3.org/2001/XMLSchema, string, 0, -1, true)])

 

No mention of the amount field which I queried .

 

Is there some documentation which explains functions of the of the returned object which we can use to do further processing.?For example,Below given query returns an object of enterpriseSoapSforceCom.QueryResult.Now any documentation on how to proceed further from here.Any functions etc

 

 

enterpriseSoapSforceCom.QueryResult l = binding.query(s);

 

 

 

 

 

sfdcfoxsfdcfox
I wonder if there's something else amiss, then. I'll try experimenting and see if I can come up with anything.