You need to sign in to do that
Don't have an account?
MT Dev
Rookie Problem: Contact.CreatedDate Disappears from Web Service Results
I'm using Visual Studio 2005 to attempt to create a web service that wraps the API so different applications (internal) can utilize Salesforce.com data. When I execute a web service that returns an array of Contact objects (using the enterprise wsdl), the CreatedDate dissapears from the results. However, right before I end the web service, I can see the created date while debugging. Here is a sample:
Code:
Code:
Code:
[WebMethod] public SalesforceApi.AppExchangeService.Contact[] GetContacts(string fieldList, string criteria, string username, string passcode) { SalesforceApi.BindingApi binding = new SalesforceApi.BindingApi(username, pwd); SalesforceApi.ContactApi contactApi = new SalesforceApi.ContactApi(binding); SalesforceApi.AppExchangeService.Contact[] contactList = contactApi.Query(fieldList, criteria); return contactList; }The result comes out without several fields. In particular, here is the results around CreatedDate:
Code:
<AssistantPhone xsi:nil="true" xmlns="urn:sobject.enterprise.soap.sforce.com" />
<CreatedById xsi:nil="true" xmlns="urn:sobject.enterprise.soap.sforce.com" />
<CurrencyIsoCode xsi:nil="true" xmlns="urn:sobject.enterprise.soap.sforce.com" />
Is there a special setting I need to have in place in order to retain the createdDate? I did notice that
CreatedDateFieldSpecified and CreatedDateSpecified are both false, but I wasn't sure that related
to a plan SOQL statement.
Thanks in advance.
I take it that you are using enterprise WSDL.
This is from some code we developed in 2004:
Code:
That worked for us then, perhaps this helps.
GL
Gareth.
Thanks for the reply. I am including the CreatedDate in the SOQL query and I can even see the values that are populated in the object all the way through the query call. In fact, if I check the value in the command window right before the last Return call, I can see a CreatedDate value. All fields I request are popluated except this one. My sample SOQL looks like:
SELECT ID, FirstName, LastName, CreatedDate, myCustomField__c FROM Contact
I was mainly curious if anyone has seen this type of behavior where some fields are not even in the list of the result set. I can past the entire web service result (or partial) if that would be useful.
Thank you for the reply. This is very similar to the code I have written for querying salesforce. My problem is that one field I am looking for inparticular seems to disappear when I return an object of type Contact from my own Web Service. So after I have the results, I return an array of Contacts and a subset of the overall data is what gets returned.
Any thoughts in that regard?
Thanks,
Chad
Contact getContact ()
Message Edited by Gareth Davies on 04-23-2006 02:05 PM
YourObject.CreatedDateSpecified = true;
and try it then.
Gareth.
Cheers,
Chad
P.S. If there is a place I should go to report this, please let me know.