Created
December 19, 2016 17:22
-
-
Save abh1nav/e8c5dec056cdbc2397e8e71ea6757f91 to your computer and use it in GitHub Desktop.
Salesforce Dashboard Auto-Refresh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Refresh Salesforce Dashboard | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Sales target dashboard refresher | |
// @author Abhinav Ajgaonkar | |
// @match https://na22.lightning.force.com/desktopDashboards/dashboardApp.app* | |
// @grant none | |
// @require https://code.jquery.com/jquery-3.1.1.min.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const refreshMins = 60; | |
// | |
// Compute the interval based on the refreshMins variable | |
const interval = refreshMins * 60 * 1000; | |
console.log(`[CrowdRiff] Starting auto-refresher - will refresh every ${refreshMins} minutes`); | |
setInterval(() => { | |
console.log('[CrowdRiff] Refreshing dashboard'); | |
$("span:contains(Refresh)").click(); | |
}, interval); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment