+ 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