问题
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