Cascade of deletion:
- order line items
- orders
- contacts
- accounts
Accounts
Accounts no Contacts
select Id,name from Account where Id not In (select AccountId from Contact)
or
list<Account> s= [select Id,name from Account
where
Id not In (select AccountId from Contact)
AND Id not In (select AccountId from Case)
AND Id!='001E000000CaEySIAV' AND ID!='001E000001dOqGbIAK'
LIMIT 200];
delete s;
Contacts
Contacts (Basic filter)
Select Id FROM Contact WHERE ((LastName='
...
Read more »