04-22-2024 11:22 PM - edited 04-23-2024 12:12 AM
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.
04-23-2024 12:20 AM
Hello @hksnap29,
I would suggest trying with the following snap sequence:
Once you get all of the Account IDs, you should be able to use Salesforce Bulk Delete, and the Join Snap with the following settings:
Will block the process until all of the Accounts are deleted, and will pass through the Parent ID from the second Copy Branch.
Try with this approach and let me know if this helps you!
Regards,
Aleksandar.
04-23-2024 02:19 AM
You can go with the @Aleksandar_A 's approach, but you don't need to pull again from the Person object, as you will have the Person identifier as an output from the Join Snap.
So, you need only to map Person Id to be a proper input for the Salesforce Delete Snap(Deletion of the Person).
BR,
Spiro Taleski