In Salesforce, you can create various folders for internal user usage, all of which fall under the category of CollaborationGroup.
To access the “All Internal Users” folder in Salesforce Apex, you can use the CollaborationGroup standard object. This object represents the folder, and you can query it using Apex code to retrieve the folder and its contents. You can also utilize a SOQL query to filter results based on specific criteria, such as name, type, or owner.
Example:
List 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 OwnerId. You can also iterate through the folderList to obtain details of each folder.
Note: Ensure that the Apex class has the necessary permissions to access the “CollaborationGroup” object.
