Session Timeout Warning Popup for Multiple Tabs


Click here to view the demo


A javascript function for displaying a session timeout warning popup before a user times out in an application.  Below are some highlights of it’s functionality:

  • Will only display one warning popup even if a user has multiple tabs for the application open
  • As a user browses in one tab it will reset the warning popup countdown in all other tabs so they are synchronized
  • Can display a countdown in each tab’s title area of how much time is left before the warning popup
  • Easily configure times, cookie names, URLs, and messaging.

How To Use



Option Type Default Value
iSecondsTillWarning Integer 15
iSecondsTillRedirect Integer 10
sShowCountdownCookieName String TimeoutWarningDisplay
sLastAccessTimeCookieName String TimeoutWarningLastAccessTime
sWarningURL String warning.html
sLogoutURL String logout.html
sPopupBlockedMessage String Your browser blocked a popup trying to warn you that your session is about to time out. Disable your popup blocker for this site so you can receive the warning popup next time.

App Pages

Example: home.aspx

The actual pages of the app that need a warning popup.

var oSessionTimeoutWarning = new SessionTimeoutWarning();

Warning Popup

Example: warning.html

The warning popup page that will give the user the ability to continue their session or will redirect all of their app tabs to the logout page.  This page needs to be an html page so that it does not affect the app’s actual session.

var oSessionTimeoutWarning = new SessionTimeoutWarning();

Continue Page

Example: continue.aspx

The continue page that resets their session clock.  This needs to be an app page that affects the app’s actual session so it gets reset.

<script language=”javascript”>

Report Viewer 10 Blurry and Jumpy in ASP.NET

Below are solutions for two issues I experienced when implementing the ReportViewer 10 control in a new ASP.NET 4.0 web application.  The control was being loaded asynchronously and was set to size itself to the report content.

Blurry Text with Graph Images

Label text for axis or legends were showing up blurred in different browsers for different graphs.  It ended up being the css that gets generated with the control on the page.  It was setting specific widths and heights on images (using millimeters?) which caused the images to be displayed at something other than their true dimensions.  We put a class of “ReportViewerControl” on all of our controls and then put this style in our stylesheet to override the generated styles.

.ReportViewerControl img
    width: auto !important;
    height: auto !important;

Page Jumping to Top While Report Loads

If a user tried to scroll down while a report was loading, the page would jump back up to the top of the page while it was loading or when it finished.  We thought this might have been something to do with the javascript the report uses but we ended up thinking it was something more related to how ASP.NET AJAX works (that’s what the report uses to load asynchronously).  Somewhere in the javascript it is using the standard scrollTo function so since we didn’t need that function for our pages we overrode it to do nothing.

window.scrollTo = function( x,y ) 
    return true;

Easily Toggle Standard Page Override Using a Bookmarklet

What It Does

This is a bookmarklet that makes it easy to view a standard detail page that is normally overridden by a visualforce page.  I have found this useful because it makes it easier to access the Edit Page Layout link of the standard detail page.  In a few scenarios, I have overridden a standard page only for the purpose of including custom related lists.  The standard detail section is still shown which follows the established page layouts and the easiest way to customize the detail section is still using the Edit Page Layout link.

Make this the URL of your bookmark:

javascript:(function(){if(document.location.pathname.indexOf("/apex/")==0){var id=/(\?|&)id=([a-zA-Z0-9]+)/.exec([2];document.location="/"+id+"?nooverride=1";}else{document.location=document.location.pathname;}})();

How It Works

An overridden page looks like the URL below with the id being specified as a querystring.


To view the standard page you must make the URL the following:


Below is the javascript in the bookmarklet:

if (document.location.pathname.indexOf("/apex/") == 0)
  //get id from querystring and force nooverride mode
  var id = /(\?|&)id=([a-zA-Z0-9]+)/.exec([2];
  document.location = "/"+id+"?nooverride=1";
  document.location = document.location.pathname; //strip off search

Salesforce Queue Record Delegation


This is a solution for managers to easily delegate and prioritize queue records.

Key Points

  • Managers can drag records from queues to different users.
  • Managers can prioritize the records assigned to users by dragging and dropping them in the order they want.
  • A rollup of a column for each user can be calculated to provide numbers, like total estimated hours, so managers can have an idea of each user’s current workload.  This can help managers determine which users have the availability to handle more work.
  • Inline editing of records is available if managers need to adjust statuses, titles, descriptions, etc. on the fly.
  • An additional table of data can be shown at the bottom of the display for things like recently completed records if managers want to review the delegated assignments that have recently been completed.
  • This setup can work for any object type and its queues.

How It Works

The records displayed are defined using a custom SOQL query definition object, called Dynamic Queries, which is also shown in the Console 3 post.  A component was created to handle combining the queries and generating the page UI so that multiple queue management pages could easily be created by simply adding the component to new pages.  The Dynamic Queries determine the object type, so a page could be created to manage customer service case queues and another page could be created to handle lead queues.  The users, queues, and records shown are determined by the criteria in the Dynamic Queries.  Multiple users and queues can be shown on the same page so that records from different queues can be assigned to users. Quick Login As Extension

This Google Chrome extension makes it easy to login as another user for the current page being viewed.

Chrome Store Web Link

Quick Login As Extension

2015 Update!

This extension has started to receive updates and is listed in the chrome store again.  Have an issue or a great idea for this extension? Visit the github project URL below and create an Issue or contribute to it.

Main Points

  • Gives a popup of the users listed on the user listing page so you can select to login as a different user on any page.
  • When a user is selected, it logs you in as that user and keeps you on the page you were viewing.
  • When you log out, it will take you back to the page you were originally on when you logged in as the other user.

 Additional Points

  • Above the user list in the popup, the “View” dropdown is available so you can change to another view from the user listing page.
  • Only the first 4 columns from the user listing table are shown by default (including the login column) since the popup has a limited width. A “Show All Columns” button is available if you can’t identify the user you need by the default columns shown.