You need to sign in to do that
Don't have an account?

Retrieve Dashboard Id in Apex in Visualforce Component
Hi All,
I have Visualforce Page used in several Dashboards as a component and I was wondering if it were possible to dynamically retrieve the Id of the Dashboard through the Apex controller. Ultimately I would like to run a query within the Apex controller based on the RunningUserId of the Dashboard being viewed, as this VIsuaforce page is being used on several Dashboards. I'd prefer not to create a new Visualforce page for each Dashboard.
There is a Dashboard table that you can query. It might get you started http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_dashboard.htm
Yes, but the query needs to be dynamic based on which dashboard the Visualforce page is on. Other than extremely ugly javascript workarounds, I can't find any clean way to do this.