How to find all customer accounts with no active contacts?

Joseph Navarro
Giga Contributor

Hello, I am trying to figure out how to get a list of all customer accounts with no active contacts.

Thank you!

Joseph Navarro

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Hi, this may not be as simple as you'd hope as you are effectively trying to identify records that don't exist.

So exactly how will depend on the intended use of the information and importance to your business.

I am not sure if you can do something with a pivot table in SNC reporting.
If not, the simplest solution would be to extract a list of accounts, and a list of accounts for active users from your instance then in excel deduplicate the active users accounts list, and compare to the accounts.
You could also write a simple background script as a 1 off to identify the accounts.
If there is a business requirement to track this information in real time, you could add a field to the accounts table and then an after update BR on your contact table triggered if a record is activated\deactivated, which would check for any active users against the same account and update the account record with the result.

Varshith Kuraga
Tera Guru

You can go to customer_contact table and personalize your list with bringing the Account field to your list and now filter out the accounts with empty