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
Sparky JaneSparky Jane 

How to get all the FOLDERS from Report & Dashboards?

Hi all,
       I would like to get all the folders that are present in Report & Dashboard using a query in apex class.

Thanks in advance,
Spark Jane

Best Answer chosen by Sparky Jane
RamuRamu (Salesforce Developers) 
You can query like this

SELECT id,name,developername,type FROM folder where type in ('Report','Dashboard')

Please mark this as the best answer if it answered your question for others benefit.

All Answers

RamuRamu (Salesforce Developers) 
You can query like this

SELECT id,name,developername,type FROM folder where type in ('Report','Dashboard')

Please mark this as the best answer if it answered your question for others benefit.
This was selected as the best answer
Deepak Kumar ShyoranDeepak Kumar Shyoran
You can get all of folder by using below code and can filter over a set of folder using Type

List<Folder> myFolder = [select id,Name,Type from folder ];
for(Folder f: myFolder)
System.debug('-Folder-'+f);