function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
S_2013S_2013 

Inactive contact hiding from their parent Account's owner?

I see there is a Best Practices discussion for this (http://boards.developerforce.com/t5/Best-Practices-Discussion/Hiding-inactive-Contacts/m-p/60760#M4571) but What I would want to know is that, is it possible to hide the contacts based on a criteria based sharing rule from the owners of their parent accounts as well?

 

Contact OWD is private. I have a status field on Contact and I share only those Contacts with my org people if they are of status = Active.

But this sharing rule is overriden when I, am the account owner. I can still see the Inactive Contact if I am the owner of the account.

I tried to change the OWD for Contacts to Private AND Contacts under Accounts to Private as well but no use.

Can anyone please help me?

Best Answer chosen by Admin (Salesforce Developers) 
AroraAnupAroraAnup

Hmm....makes sense. What is the OWD set on Contact? Is it Private or Controlled by Parent? It looks like it is set to Controlled by Parent, which is why the Account owner is still able to see the Contacts.

In case it is Private and the Account Owner is still able to view the Contacts, then here is I guess what you can also do:

 

1. Create a generic Account, which is owned by the Super user.

2. When a contact becomes Inactive, in addition to its Owner, you should also change the Account to this generic Account that is owned by this Super user.

3. Just for tracking purposes, pass the initial Account name into a custom field on the Contact record. This way when you run a report on Inactive Contacts, you will always be able to track the previous Account that it was associated to.

 

Hope this helps. Let me know if you have any queries.

All Answers

AroraAnupAroraAnup

Here is a potential solution to your question:

 

Once a Contact is flagged as INACTIVE, what you can do is write a Workflow rule, that will change the Contact Owner to a user who sits at the top of the role hierarchy or is a System Admin. Basically the idea is that the data owned by this user is not shared with anyone in the system.

As soon as the Contact is set as Inactive, the workflow will change the owner of the Contact to this Super user. Once ownership is changed, nobody (except for this super user) will be able to see the inactive contacts.

 

Hope this helps! Let me know how it goes.

S_2013S_2013

Thank you indeed CloudKnight for your prompt reply... But the solution you stated is exactly what we are doing currently. The problem we are facing is that, although the Contact is now belonging to the super user, the Account to which it is associated is not inactive and belongs to a valid user. So this Account owner can still see the contact even though it is now not shared by criteria based sharing rules, and its owner is the super user in system. Any ideas how this can be prevented? Anyone encountered smilar issue?

AroraAnupAroraAnup

Hmm....makes sense. What is the OWD set on Contact? Is it Private or Controlled by Parent? It looks like it is set to Controlled by Parent, which is why the Account owner is still able to see the Contacts.

In case it is Private and the Account Owner is still able to view the Contacts, then here is I guess what you can also do:

 

1. Create a generic Account, which is owned by the Super user.

2. When a contact becomes Inactive, in addition to its Owner, you should also change the Account to this generic Account that is owned by this Super user.

3. Just for tracking purposes, pass the initial Account name into a custom field on the Contact record. This way when you run a report on Inactive Contacts, you will always be able to track the previous Account that it was associated to.

 

Hope this helps. Let me know if you have any queries.

This was selected as the best answer
S_2013S_2013
Fantastic solution CloudKnight
Solves all my problems...!
Will try to convince my client with this solution
Thanks again
AroraAnupAroraAnup

Glad I could help. Let me know how it goes :)

S_2013S_2013

BTW OWD for Contact was private and not controlled by parent. So your solution provided will be just right for my prob.