beatbox bulk delete: Getting MALFORMED_ID

85 views Asked by At

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

There are 1 answers

0
hynekcer On BEST ANSWER

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.