【问题标题】:How to do a Salesforce query using apache camel related to the field CreatedDate?如何使用与 CreatedDate 字段相关的 apache camel 进行 Salesforce 查询?
【发布时间】:2020-07-24 20:49:54
【问题描述】:

我正在使用 apache camel 根据对字段 IDCreatedDate 施加的条件进行 salesforce 查询以获取某些记录。这是toD 声明

.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")

这会返回这个错误响应

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}

看起来它忽略了创建日期中的+。我该如何解决这个问题?

【问题讨论】:

    标签: java apache-camel salesforce


    【解决方案1】:

    预计日期和日期时间格式在这里:https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm

    不接受以毫秒为单位的点,如果您不需要时区 - 也删除带有“+”的部分。祖鲁时间最接近你所拥有的,选择 2019-01-03T12:12:27Z 吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-14
      • 1970-01-01
      • 2014-01-09
      • 2018-02-22
      • 2021-10-12
      • 1970-01-01
      相关资源
      最近更新 更多