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
georggeorg 

Invalid class: reportresults

I am exploring the analytic api introduced recently. While i am executing the code given in the developers guide i am getting an error message from developer console="Invalid class: reportresults"

// Get the report ID
List <Report> reportList = [SELECT Id,DeveloperName FROM Report where
    DeveloperName = 'Closed_Sales_This_Quarter'];
String reportId = (String)reportList.get(0).get('Id');

// Run the report
Reports.ReportResults results = Reports.ReportManager.runReport(reportId, true);
System.debug('Synchronous results: ' + results);

The code i am executing here is directly copied from developers guide. Please help me to recover from this error.

Thanks,
George
Ashish_SFDCAshish_SFDC
Hi George, 


Hi Andrew. Is your org a Spring ’14 org? If it is Winter ’14 you will not be able to use this code because the Analytics API in Apex is new for Spring ’14. I did all of this work in a pre-release org. You can sign up here if you want to experiment with features in Spring ’14.

https://www.salesforce.com/form/signup/prerelease-spring14.jsp

Look fo rmore information on the Reports result class below, 

http://peterknolle.com/asynchronous-reports-with-the-analytics-api-in-apex/


Regards,
Ashish