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
divyajain1divyajain1 

Cannot get all the reportfolder list using the webservice/metadata APIs

HI,

 

I am trying to get the list of all Reports defined in salesforce.com using webservices/metatdata APIs. To get the report list,  I am using metadata APIs to first retrive the list of Report Folders ( looks it is needed to get the list of reports).

 

When I run my program, I am only getting the list of folders that I have created and "unfiled$public" folder. I am not getting folders like "Activity Reports" Folder, "Lead Reports" etc. I have verified that the permisions on these report folders are same the folder created by me, i.,e. "accessible to all users."

 

Please let me know if I need to enable any other particular settings or if the following way to get this lists incorrect.

 

Thanks,

Divya.

 

String component = "ReportFolder";
         ListMetadataQuery query = new ListMetadataQuery();
         query.setType(component);
          FileProperties[] results = metadatabinding.listMetadata( new ListMetadataQuery[] {query}, 20.0);
          if (results != null) {
           for (FileProperties n : results) {
                System.out.println("Component fullName: " + n.getFullName());
                System.out.println("Component type: " + n.getType());
            }
        }  else {
            System.out.println(" results is null");
        }

 

aalbertaalbert

I found this interesting board post that is a similar topic. Check it out. 

Simon Fell has posted some sample code here.

divyajain1divyajain1

HI,

 

Thanks for the reply. I did looked into the links you mentioned but even in that case I am not getting all the folders. I am getting only the ones that I created. Also if I use the foldername as "My Personal Custom Reports", it does not give me any reports. Not sure what is the real value of the folder to be used to get the list of all my reports.

 

Thanks,

Divya.

taralextaralex
I'm having exactly the same problem. Can't retrieve all the folders, the only ones I'm getting back are unfiled$public and the folders I've created.
Has anyone been able to figure this out?