Free Salesforce.com S-Control to Dynamically Auto Refresh Dashboards

Written by ShamrockCRM on March 14, 2009 – 3:06 am



Ok, I have received many positive comments about this functionality that I posted about before regarding the auto refreshing of either a home page dashboard or an individual dashboard when a user simply visits the page.

I know that Salesforce offers the ability to schedule dashboards, but this is really to be used in the case of an organization having MANY dashboards and a Salesforce.com Administrator not wanting to schedule hundreds of dashboard refreshes.

Take a look at my original post explaining this Salesforce.com Dashboard Refreshing functionality

I am going to provide this useful code for you to use for free.  This is once again a very simple piece of code, but somewhat useful and unique.

1) Create an S-Control called whatever you’d like.  I called mine “Auto Refresh Dashboard.”

2) Paste in this code:

<code lang="html">&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;
function clickButton(){
var thebutton = parent.document.getElementsByName('refresh');
thebutton.item(0).click();
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="clickButton()"&gt;
&lt;/body&gt;
&lt;/html&gt;</code>

3) Create a Home Page Component of type “HTML Area.”
4) Click “Show HTML”
5) Paste in the following code:

<code lang="html">&lt;iframe name="rss_iframe" src="/servlet/servlet.Integration?lid=XXXXXXXXXX&amp;ic=1" width="0%" height="0"&gt;&lt;/iframe&gt;</code>

6) Replace XXXXXXXXXX with the Salesforce.com record ID of the S-Control that you created above.
7) Add this home page component to your home page layout.

Now, the home page dashboard will always automatically refresh when Users visit their home page, preventing confusion by keeping data up to date!

Have fun!




13 Responses to “Free Salesforce.com S-Control to Dynamically Auto Refresh Dashboards”

  1. By amjad on Apr 18, 2009 | Reply

    Hi Tanner,
    I am a regular visitor of your website and I must say that you rock!!!
    Your advanced search and auto refresh dashboard functionality are just great.
    Could you tell me how can I implement the auto referesh dashboard for the dashboard page?

    cheers

  2. By therese on Jun 16, 2009 | Reply

    hi tanner
    i just happened to vist your site and thought of trying the above

    when u say Replace XXXXXXXXXX with the Salesforce.com record ID of the S-Control, i assume u mean the data after the .com ? https://emea.salesforce.com/ 01N20000000DRG0

    the auto refesh doesnt work on the homepage. as it still shows the last refreshed time. is there something wrong that i am doing

  3. By therese on Jun 16, 2009 | Reply

    the code appears on the home page at the bottom! am i doing something wrong

    Refresh Dashboard

  4. By Christine on Aug 11, 2009 | Reply

    Hi Tanner,

    I’m also wondering how to implement the auto refresh for individual dashboards.

    Your code is exactly what I’ve been looking for to post our sales numbers live on an LCD screen in our office.

    Thanks so much for your help!!!

    Christine

  5. By Prahallad Mohanty on Aug 28, 2009 | Reply

    Salesforce Record ID is the Id from the SControl table. You need to get that using the middleware tool(e.g. Pervasive/Cast Iron). Also remember to click “Show HTML” before pasting the code for Home Page Component.

    It worked like a charm in our instance.

  6. By Mike on Apr 21, 2010 | Reply

    How can this be done now that SF doesnt have S-Control option?

  7. By Clark Korb on May 9, 2010 | Reply

    Hi,

    Any idea how to adapt this via a Visualforce or equivalent, now that S-Controls are no longer available?

    Thanks,

    Clark

  8. By Nilesh on Jun 23, 2011 | Reply

    i want to refresh a opportunity page while it load…..

    is it possible to do this..

    thanks in advance,
    Nilesh

  9. By NicholA on Jul 4, 2011 | Reply

    Does this work with enterprise?

  10. By ShamrockCRM on Aug 15, 2011 | Reply

    Yes, it worked with Enterprise. Not sure if it still does. S-Controls are no longer supported and it has been a long time. You can still try, but YMMV.

  11. By oscar on Jan 16, 2012 | Reply

    Hi,

    I have tried your solution, creating the s-control, then the HTML area replacing the “xxxxx” witht the s-control id and added the hp component to the home page layout all I got is the component shown as:

    I would really appreciate any help on this matter!
    Thank you

  12. By nidhi on Apr 15, 2013 | Reply

    Hi,

    You really came up with a nice concept but S-control no more supported in enterprise editions too ,

    How to use refresh concept now

    Please share if you have any thought to use it without s-control

  13. By Daniel on Jul 2, 2014 | Reply

    I have S-Controls on but for some reason I wasn’t able to get this to work. Nonetheless, here’s a solution that seems to be even more simple:

    1) Create a new Home Page Component, Type ‘HTML Area’
    2) Click the ‘Show HTML’ checkbox
    3) Paste the following code:

    window.onload = function() {
    var dashboardButton = document.getElementById(‘db_ref_btn’);
    dashboardButton.click();
    }

    4) Click Save
    5) Add to your Home Page Layout

    It was this simple for me. You can see the dashboard start to refresh as soon as you load the home page.

You must be logged in to post a comment.