Search code examples
pythonsalesforcebeatbox

python salesforce beatbox: beatbox._beatbox.SoapFaultError: 'INVALID_FIELD'


I am using beatbox to connect to Salesforce from Python and it works fine until I try to add constraint with dates.

When I add a CreatedDate constraint it fails saying

File "/Library/Python/2.7/site-packages/beatbox/_beatbox.py", line 332, in post
    raise SoapFaultError(faultCode, faultString)
beatbox._beatbox.SoapFaultError: 'INVALID_FIELD' "INVALID_FIELD: from Assets__c where CreatedDate > 2012-08-08 ^ ERROR at Row:1:Column:1061 value of filter criterion for field 'CreatedDate' must be of type dateTime and should not be enclosed in quotes"
  • How can I send a datetype object to query and fix this?

Solution

  • Just realized, it needs date in format that SFDC way - 2012-08-15T00:00:00+00:00

    reference - http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_dateformats.htm