本文介绍了Beatbox批量删除:获取MALFORMED_ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像upsert一样,我想使用beatbox批量删除特定自定义索引的记录.有什么办法吗?

Just like upsert, I want to bulk delete records of a particular custom index using beatbox. Is there any way?

我在执行操作时得到MALFORMED_ID.

I am getting MALFORMED_ID when i am doing it.

推荐答案

beatbox中的删除命令取决于 delete()SOAP API调用.它需要知道已删除对象的主键ID,并且不可能使用外部ID,因为应该事先确切知道要删除的内容. (联系人对象示例)

Delete command in beatbox depends on delete() SOAP API call. It requires to know primary keys Id of deleted objects and there is no possibility to use external ID, because it should be known beforehand exactly what is deleted. (example for Contact object)

sql = "SELECT Id FROM Contact WHERE my_external_id__c in ({})".format(
    ', '.join("'{}'".format(x) for x in external_ids)
)
svc.delete([x['Id'] for x in soap.query(sql)])

您可以在附近的文档中看到update()和upsert()调用支持外部ID.

You can see in the docs nearby that update() and upsert() calls support external IDs.

这篇关于Beatbox批量删除:获取MALFORMED_ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 04:46