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
icemft1976icemft1976 

Apex / API access to Dashboard object?

I know there are JavaScript ways to try to replicate a user clicking a dashboard refresh everytime the home page loads) - but I wanted to know if the API exposes the ability to call a refresh directly against a known dashboard Id.

 

I know I  could schedule a job via the API  every 8 hours - so the missing piece is the Dashboard object/method access. 

 

Am I right in thinking it's not exposed?

 

Why?  We have about 7 Dashboard components on a home page and I don't want users to open SF everytime only to have to sit waiting while  everything spins. At that point they probably will navigate away before it ever completes (users' tolerance for delays decreases dramatically if its tied to a common repetitive action...no matter how valuable the updated data they are waiting on)

 

thanks for any information you can provide.

 

ps - yes, I would rather ALL our staff just be trained to refresh it themselves...but of all the adoption and training efforts we have, this is probably the lowest priority and would make a useful solution that was not a hack. It's merely extending the scheduling ability we already have (like how we can schedule multiple Apex runs via the API but not the UI).

bob_buzzardbob_buzzard

You can have scheduled dashboard refreshes, but not via the API.  The standard UI gives you the ability to schedule a daily refresh.

 

I did write up a blog post regarding automatic dashboard refreshes at:

 

http://bobbuzzard.blogspot.co.uk/2011/06/automatic-dashboard-refresh.html

 

This gets the id of the dashboard from the browser, but it should be adaptable if you already know it. 

 

It would be totally unsupported though, so you'd need to be prepared for things to suddenly stop working.

icemft1976icemft1976

Thanks, Bob.

 

I had seen your writeup  - was hoping for a more standard approach (that wouldn't impact home page load times) but that seems to be the best option.

 

Thanks again for taking the time & for your reply!