Salesforce - 按 id 编辑多态查找

Salesforce - Edit polymorphic lookup by id

我需要通过 id 更新多态查找字段。我使用批量 API v48.0。如果我将数据上传到作业(例如,用于更新事件对象)

id,Lead:Who.Id
00U5f000008eventId,00Q5f000003ISwhoId

然后事件没有更新并且APIreturn工作状态

{
  "id": "7505f000002pnjobId",
  "operation": "upsert",
  "object": "Event",
  "createdById": "0055f0000032userId",
  "createdDate": "2021-12-08T11:06:29.000+0000",
  "systemModstamp": "2021-12-08T11:06:51.000+0000",
  "state": "JobComplete",
  "externalIdFieldName": "Id",
  "concurrencyMode": "Parallel",
  "contentType": "CSV",
  "apiVersion": 48.0,
  "jobType": "V2Ingest",
  "lineEnding": "LF",
  "columnDelimiter": "COMMA",
  "numberRecordsProcessed": 1,
  "numberRecordsFailed": 1,
  "retries": 0,
  "totalProcessingTime": 62,
  "apiActiveProcessingTime": 3,
  "apexProcessingTime": 0
}

如果我填写电子邮件而不是 id

id,Lead:Who.Email
00U5f000008eventId,test@mail.com

那么活动更新成功。

如何通过对象 ID 更新多态查找值?

更新查找字段本身的值时,不需要使用多态关系语法。只需按名称引用该字段,WhoId:

Id,WhoId