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
Kris HankinsKris Hankins 

Error while running $A.run() : object is not a function

I added an additional tab to a tabbed Account page last week. The new tab has two report charts on it. Everything functioned fine Friday. The reports were updating correctly and displaying the correct information without error. I log in tonight and click on that tab and I get "Error while running $A.run() : object is not a function". What gives? I checked trust.salesforce.com to see if the server instance was having issues. They are experiencing data export issues. The page still works fine in the sandbox. 

The code for the new tab is included here. 
<apex:tab label="Opportunity History"
                name="OppHistory" id="tabOppHistory">
                
                <apex:dataTable value="{!account}" var="Account" id="reportTable" rowClasses="odd,even" styleClass="tableClass">
                    <apex:Column >       
                             <analytics:reportChart reportId="00OE00000035A51"
                                       filter="{column:'Account.Name', operator:'equals', 
                                       value:'{!Account.Name}'}"> 
                            </analytics:reportChart>
                     </apex:column>
                          
                     <apex:column >
                            <analytics:reportChart reportId="00OL0000000PBEe"
                                     filter="{column:'Account.Name', operator:'equals', 
                                     value:'{!Account.Name}'}">
                            </analytics:reportChart>
                      </apex:column>  
              
                  </apex:dataTable>                    
                    
</apex:tab>

As I said, the page and reports work fine in the sandbox still. I'm hoping this is just a NA9 server instance issue. 
Best Answer chosen by Kris Hankins
Kris HankinsKris Hankins
Using <analytics:reportChart> inside a <apex:tabPanel> causes this error in the Spring 15' release. The only work around as of right now is to create a new page containing the report charts and embed that page inside the tab using an iframe.  

All Answers

KaranrajKaranraj
Make sure that you have reports in your production org with the following ids 00OE00000035A51, 00OL0000000PBEe. IDs are non identical, try to get your report ids dynamically in your code
Kris HankinsKris Hankins
Hi Karanraj,

The reports are there and the IDs are correct. As I mentioned, nothing has changed since Friday except the roll out of Spring '15 into our instance (NA9). 
Kris HankinsKris Hankins
Using <analytics:reportChart> inside a <apex:tabPanel> causes this error in the Spring 15' release. The only work around as of right now is to create a new page containing the report charts and embed that page inside the tab using an iframe.  
This was selected as the best answer