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
Amit4SFDCAmit4SFDC 

How to get Last Refresh Date of a Dashboard using Apex Code ?

I want to get information about Last Refresh Date of dashboard in Apex Class, It would be great for me if any one could help me in to this  .

sfdcfoxsfdcfox
As far as I can determine from the documentation, this value isn't available, but you might take a look at the following fields:

LastModifiedDate, LastViewedDate, LastReferencedDate.

The documentation doesn't exactly cover the values in these fields (e.g. if a modification includes a refresh), so any one of these fields might get what you're looking for.

You can query those fields through the Dashboard object:

Dashboard record = [SELECT Id,LastReferencedDate,LastViewedDate FROM Dashboard WHERE Id = :dashboardId];