beatbox bulk delete: Getting MALFORMED_ID

只愿长相守 提交于 2019-12-25 06:27:17

问题


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

I am getting MALFORMED_ID when i am doing it.


回答1:


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)])

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



来源:https://stackoverflow.com/questions/43625053/beatbox-bulk-delete-getting-malformed-id

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!