CRM dashboards are meant to present a big picture that combines different data points as a quick and easy-to-understand visual summary. In Creatio, dashboards are built into each section with a rich feature set that lets you design and build them to suit any reporting needs. These dashboards however are static and refresh only if the browser window is refreshed, or if you navigate away and back to the dashboard area.

If you would like your screen to serve as a real time dashboard of CRM data, there isn’t a setting in Creatio that will let you do that at the time of this writing. There is, however, a solution to this which involves adding a widget to the dashboard that listens to a message from a timer module. Each time the timer ticks based on a set interval, it can refresh a message to the dashboard and voila, your Creatio dashboard suddenly acts like there is a ghost refreshing it without anyone touching a button.

Here are the steps to accomplish this:

Step 1 – Create the Creatio dashboard module with the timer logic

Create the Creatio dashboard module with the timer logic

Here is the code you can paste into the module:

define("UsrDashboardRefreshHelper", ["ext-base", "terrasoft", "sandbox"],
function(Ext, Terrasoft, sandbox) {
 
   var getView = function() {
      var config = {
         id: "UsrDashboardRefreshHelper",
         selectors: {
            wrapEl: "#UsrDashboardRefreshHelper"
         },
         items: []
      };
      return Ext.create("Terrasoft.Container", config);
   };
   return {
      timerId: 0,
      myTimer: function() {
         sandbox.publish("ReloadDashboard", null, ["Dashboard sandbox id goes here"]);
      },
      init: function() {
         this.timerId = setInterval(this.myTimer, 6000);
      },
      render: function(renderTo) {
         var view = getView();
         view.render(renderTo);
      },
      destroy: function() {
         clearInterval(this.timerId);
      }
   };
});

Add a message element to the module such that the Code is “ReloadDashboard”, Direction is “Publish” and Mode is “Address”.

add a message

Step 2 – Find the sandbox ID of the dashboard that needs to auto refresh

Turn ON the Debug setting in Creatio. This can be done in the System Settings area. Make a note to turn this OFF once you are done with all the changes described in this article.

Use the developer console (in chrome hit F12) to open the DashboardModule.js file and add a breakpoint at the line:

sandbox.subscribe("ReloadDashboard", this.onReloadDashboard, this, [sandbox.id]);

Find the sandbox ID of the dashboard that needs to auto refresh

Now, if you hit F5 and refresh your page, the code will stop at this line and allow you to get the sandbox ID.

getting the sandbox ID

Add this sandbox ID to the “my Timer” method in the module you created previously. For Accounts, the line of code might look like this:

sandbox.publish("ReloadDashboard", null, ["SectionModuleV2_AccountSectionV2SectionDashboardDashboardModule"]);

Step 3 – Add a dashboard widget that uses the above module

dashboard widgets
module setting
widget

Now save your dashboard, wait 6 seconds, and you should see your Creatio dashboard refresh. In the code, the value is set at 6000 (milliseconds). You can obviously change this value to a larger more convenient frequency depending on how often you need the dashboard to refresh.

For help customizing, integrating, supporting, or otherwise optimizing your Creatio instance, check out our Creatio services!

Posted in:

Looking for Creatio help?

We do training, customization, integration, and much more. Contact us today.