问题
I am doing a salesforce query to fetch certain records based on conditions imposed on the field ID
and CreatedDate
using apache camel. This is the toD
statement
.toD("salesforce:query?sObjectQuery=Select Id, Name, CreatedDate from Account where Id > '' and CreatedDate > 2019-01-03T12:12:27.000+0000 order by CreatedDate, Id limit 10&rawPayload=true")
This returns this error response
org.apache.camel.component.salesforce.api.SalesforceException: {errors:[{"errorCode":"MALFORMED_QUERY","message":"\nCreatedDate > 2019-01-03T12:12:27.0000000 order by CreatedDate, Id limit\n ^\nERROR at Row:1:Column:101\nline 1:101 no viable alternative at character ' '","fields":null}],statusCode:400}
Looks like it is ignoring the +
in the Created Date. How do I solve this problem?
回答1:
Expected date & Datetime formats are here: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm
Dot for milliseconds is not accepted and if you don't need timezone - drop the part with "+" too. Zulu time is closest to what you have, go with 2019-01-03T12:12:27Z ?
来源:https://stackoverflow.com/questions/63081281/how-to-do-a-salesforce-query-using-apache-camel-related-to-the-field-createddate