Python API与Salesforce Rest API返回记录数量不一致
我从版本2的代码开发了版本3的Python API,除了查询数据有一些小变化外,其他部分都保持不变。而且两个版本的WHERE条件也是一样的。当我直接在sfdc上查询数据时,得到的记录数量是一样的,这说明查询本身没有问题。但是,我在版本3中得到的响应是125条记录,而在版本2中是250条记录。这是和sfdc有关,还是和Python API有关呢?
response = client.post("/composite", data=body, **kwargs)
records = []
for r in response.get("compositeResponse", ()):
if r["httpStatusCode"] >= 300:
continue
if flatten:
for rec in r["body"]["records"]:
records.append(rec)
else:
records.append(r["body"]["records"])
return records
这里的客户端是sfdclib.rest.SfdcRestApi对象,地址是0x7ffb887a99d0
1 个回答
0
复合查询是特别的。你在手动运行每个“内部”查询时,得到的结果数量是否相同?也许有些查询只是设置了 nextrecordsurl
,但你忽略了它,只获取了第一“页”的结果。