Is there any way with which I can check what all the places a specific public group is used for and then delete the public groups in Salesforce?

918    Asked by DavidEdmunds in Salesforce , Asked on Jun 6, 2024

There is no way to identify where all places any Public Group created is used in Salesforce.com.

The public group can be used at -

  1. Sharing Rules
  2. Record Sharing
  3. Queues
  4. List Views
  5. Other Public Groups (nested)
  6. Report Folders access
  7. Document Folder access
  8. Library sharing

But it is strange to me that I can delete the public group from the Salesforce.com instance which is in use; say in "Sharing Setting"! And the effect of this is that the Sharing setting entry also gets deleted without informing me!

Is there any way with which I can check what all the places a specific public group is used for and think of an alternate option and then delete the public group from Salesforce.com?


Answered by Dipika Agarwal

Yes sure, you can check what all the places a specific public group is used for and then delete the public groups in Salesforce.


You can use SOQL like below to get a list of Accounts with which the record has been shared and the Cause(Rule, Manual etc).
SELECT ID, AccountId , IsDeleted, RowCause FROM AccountShare WHERE UserOrGroupId='???????'
You can repeat this for all custom and standard objects and you can get the list of objects itself from the following query.
list allObjects = Schema.getGlobalDescribe().Values();

This will tell you the records of different objects which are shared with the group. As long as you would like to know only records which are shared, this approach is good enough.



Your Answer

Interviews

Parent Categories