In Salesforce we can create different folders for use by internal users. everyone is under CollaborationGroup
.
To access the “All Internal Users” folder in Salesforce Apex, you can use the standard object CollaborationGroup
. This object represents the folder, and you can query it using Apex code to retrieve the folder and its contents. You can also use the SOQL query to filter the results based on specific criteria, such as name, type, or owner.
Example:
List<CollaborationGroup> folderList = (SELECT Id, Name, CollaborationType, OwnerId FROM CollaborationGroup WHERE CollaborationType="Files");
This query will return all folders of type “Files”, and you can access their properties, such as ID, Name, and Owner ID. You can also scroll through the folder list to get the details of each folder.
Note: Make sure the Apex class has the necessary permissions to access the “CollaborationGroup” object.