Salesforce bulk query and bulk delete
Hi,
I'm working on Salesforce objects that are related Person and Accounts. A person can have many accounts. I'm fetching the Accounts object with Person Id(Parent Id). This will return multiple records and I have to delete all these records before deleting the Person object. When I'm querying Salesforce using SOQL Snap with a parent Id, it returns each record at a time instead of a list. As the snaps are executing sequentially, my delete snap is deleting only one Account record and trying to delete the person which is returning a conflict as it has associated Accounts.
This is how I'm fetching Account object:
Response:
I have to delete all these Account records as bulk or through some loop and only after that I have to delete the Person. how to achieve this.