I am trying to implement this -> (http://coenraets.org/blog/2014/02/building-interactive-dashboards-in-visualforce-pages) in my org.

But everytime I am getting an error like this:

ReferenceError: app is not defined

What may be the possible reason? any idea?

  • 1
    can you post some code?
    – Ashwani
    Mar 4, 2014 at 10:37

1 Answer 1


Without seeing your code, it's impossible to tell. However, I can throw a few "usual suspects" out.

  1. Make sure you have uploaded the javascript resources Christophe references.
  2. Make sure that your vf page Loads with out any other errors. Specifically look for 404 errors loading Javascript files

I suspect strongly that the app.js file isn't being loaded properly, either because it's not on the server, or because you used a slightly different name for the resource bundle than Christophe did. In either case, if app.js isn't loaded properly, you'll get an error trying to initialize it.

On the off chance that it's an issue with static resource bundles and you're seeing a 404... First ensure that you've created the static resource bundle with the files that Christophe mentions.

Secondly, Here's the breakdown of the javascript include line for app.js

<script src="{!URLFOR($Resource.dashboard_embedded, 'js/app.js')}"></script>

In the above line ensure that "$Resource.dashboard_embedded" string properly names your resource bundle. In other words, if you uploaded the javascript as "awesomeDashboards" you'll have to change $Resource.dashboard_embeded to $Resource.awesomeDashboards.

Additionally, if you've moved the files around within the static resource bundle, you'll need to ensure that the 'js/app.js' is edited to reflect your new folder structure.

Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .