i need to create a custom keyboard shortcut for the Salesforce console, but the documentation did not have a sample but have listener samples to include in a vf page. please someone share your ideas on how it can be done? I know that we need to write a listener to listen the event from the console. but i am bit confused where to write and how to hook the listener code to Salesforce console. i referred this article, http://www.salesforce.com/us/developer/docs/api_console/index.htm

Thanks, Baskaran


Here's a blog post by Salesforce explaining the process

Copy paste from post in case it goes way:

Creating a Custom Shortcut – The Logout of salesforce.com Hotkey

One of the simplest keyboard shortcuts is logging out of Salesforce. Let's set it up.

Defining the Keyboard Shortcut

  1. First, go to the Keyboard Shortcuts setup page for your Console and via Setup-> Create-> Apps-> Your Console -> "Customize keyboard shortcuts"-> Edit.

  2. Now add a new shortcut. "Click Add Keyboard Shortcut"

  3. Fill out the shortcut details. Note that the name of the shortcut event is name spaced with "customShortcut". This is good practice and avoids possible conflicts with existing or future events in the Console.

  4. Now we save and move on to the next step.

Since we want the shortcut to be available at all times, the listener must also be available at all times in the Console. Footer components are a good fit for housing such a listener, since they are always on the Console page and cannot be closed.

Additionally, we don't want to display any information to the user when the shortcut is invoked, so we will keep our listener hidden.

Creating the Listener in Visualforce

To build our listener component, first we create the Visualforce page that contains the listener logic. Let's name the page cccShortcutsListener (ccc stands for Custom Console Component). The code for this can be found here - http://wiki.developerforce.com/page/Efficiency_Gains_With_Keyboard_Shortcuts

Housing the Listener in a Custom Console Component

Next we create the Console Footer Component to house this listener. This can be done on Setup-> Customize-> Service Cloud Console-> Custom Console Components-> New. Create a new component for cccShortcutsListener and save. Be sure to set the component as "Hidden". Let's name our component "ShortcutsListener".

Adding the Custom Console Component Listener to the Console

Finally we add the new ShortcutsListener component to our Console. Go to Setup-> Create-> Apps-> Your Console and add it.

That's it. The next time you open the Console and hit Shift+X, you will be logged out of salesforce.com.

More Keyboard Shortcuts

Some additional sample shortcuts are listed below, along with the number of clicks saved.

Minimize/ Maximize footer component. Clicks saved - 1 Get next work item. Clicks saved – 3 to 4 Close currently focused case (set status to closed), close case tab and get next work item. Clicks saved – 5 to 8 The code for these shortcuts is available here - http://wiki.developerforce.com/page/Efficiency_Gains_With_Keyboard_Shortcuts

Keyboard shortcuts can help eliminate clicks and automate agent flows. Custom keyboard shortcuts offer significant flexibility with the ability to invoke JavaScript, Apex and Visualforce calls. It is important to keep in mind however that hotkeys must be used appropriately, complement mouse action, and always have a clear UI alternative.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.