Warning: Delete operation through Salesforce API does not perform a check between record ids and the object type!
I’ve been working with Salesforce for ten years now, doing countless data loads and DML operations, and only today I found out about this! Thank you Tony Spelkens for pointing this out to me.
So we all know that through dataloader we can perform multiple actions like insert, upsert, update, export and of course DELETE.
Now when you chose one of those actions, the first step of dataloader actually asks you on which object you want to perform your operation on:
So you would think that, when you select your CSV containing the ids you would like to delete the records from, Salesforce would check down the road that the ids are actually of the corresponding chosen object?
The short answer is NO, it doesn’t!
It seems no check is performed and it will just delete all the record ids you have in your CSV file. Your column in your CSV could even contain ids from multiple different objects at once if you’d like.
Watch the following video in which I demonstrate this dangerous fact
Although you must always pay attention when doing bulk loads, I think this is a very dangerous thing!
I really hope Salesforce sees this post and somehow finds a way to at least give a warning if there is a mismatch between the chosen object and the records provided in the CSV in the near future.
Maybe there are others like me out there in the Salesforce Community that didn’t know this, so I wanted to share this with you all.