Month: June 2019

How to automatically refresh your Dynamics 365 Dashboard in UCI

Procedure:

1. Create an html web resource and add the following script in it:

<html><head>
     <title></title>
     <script type="text/javascript">

         // add visual timer just because we can
         var d = new Date();
         document.write(d.toLocaleTimeString());

         // refresh parent (dashboard) every 30 seconds
         // (timeout is in milliseconds)
         setTimeout("window.parent.document.getElementById('RefreshDashboard').click();", 30 * 1000);
     </script>
   <meta><meta><meta><meta><meta></head>
   <body>
</body></html>

2. Add the html web resource to a dashboard.

3. Click on “Edit Component” and make sure the web resource’s “Visible By Default” property is unchecked.

Explanation:

On the dashboard, there is a button called “Refresh Dashboard”. The ID of this button is RefreshDashboard. The script above clicks this button every 30 seconds. You can change the button to put in another value for seconds.

Filed under: Blog