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(document.location.search)[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.

/apex/Account?id=0016000000N1OWK&sfdc.override=1

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

/0016000000N1OWK?nooverride=1

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(document.location.search)[2];
  document.location = "/"+id+"?nooverride=1";
}
else
{
  document.location = document.location.pathname; //strip off search
}
Advertisements

Salesforce Queue Record Delegation

Introduction

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.

Console 3 for Salesforce

Jump to video demo

Review

This is another custom console solution that replaces the other console solution I described in Console 2 for Salesforce.  The things we tried to improve upon are:

  • We wanted to display the record data in standard html tables instead of the Enhanced List controls.  This would be less page heavy, we could have more than 5 tables on a page, and the table heights and column widths would be automatically sized to their records.
  • We wanted users to be able to see on one page a set of tables but still know if there were new records in their other tabs.
  • We wanted to create the queries used to populate the pages with something other than the listviews feature.  It still needed to be something an admin could do without getting into code like the listviews were.
With this new solution there are three main pieces to it.

Query Creation

We created a way for admins to create the different pieces of a SOQL query (columns to display, filter criteria, sorting) much like they did with the listview feature.  They select fields for each section using a Field Browser dialog we created where they can browse all the fields and object relationships starting from the base object for the query.  They can then sort the fields and enter their filter criteria formulas.  Behind the scenes, apex builds the actual SOQL query that is stored and later executed on the console pages.  A custom placeholder is available for the filter criteria that identifies a current user id.  This is later used for easily previewing queries as other users.

Console Template Creation

After admins define the queries, they create a console template.  A console template defines what tabs will be available, what queries will be shown under each tab, and what specific roles and users a template should be shown for.  The admin creates the tabs they want to show at the top of the page and then assigns different queries to the tabs.  The queries will show as tables displayed one after the other under their tab when the tab is selected.  When users view their console page, a template is automatically chosen for them based on the role and user assignments.  Roles are selected for more general assignments but specific users can be selected for a template to override a general role assignment elsewhere.

To easily see what other users would see, there is a Preview dropdown that allows admins to preview the console template as any user in the system.  This makes it easier to verify that your queries are right and to troubleshoot any issues that users submit later.

For each query, admins can choose to display add links, display edit links, display delete links, and to identify unread records.  Identifying unread records is a very helpful feature because it lets users know which records have been created or modified since the last time they marked a table as read.

Console Viewing

When a user goes to their console page, a console template is loaded from the system for them.  It loads the tabs for the queries and then loads all the queries for the first tab and displays the resulting tables.  As users click to a different tab, the page loads the queries and resulting tables for the new tab.  The tables and tabs refresh automatically every so often to make sure the latest data is available.

For queries that have the Identify Unread feature turned on for them, unread queries are highlighted and counted for each table.  Unread records are also counted for the tabs that are not currently being viewed.  This is very helpful in letting users know if there is new information in tabs they are not currently looking at.

Technologies

This solution uses apex and visualforce for the admin pages and front end page.  The field browser dialog uses apex describe information for listing the objects and fields in the system.  The front end page uses javascript remoting for loading the tabs and tables dynamically.

Video Demo 


Salesforce Product Packages

Below is our current solution for how we create product packages and use them in opportunities.  I hope to do other posts like this that give examples of solutions without going into code.  We may build some of these solutions into AppExchange apps one day.

Creating Packages

We first create products in Salesforce that will act as the parent products for packages.  They are the products that users can search for and add to an opportunity like normal.  Using some custom objects and a visualforce page, we provide a way for other products to be related as child products to the parent product.  Children have options like initial quantity, max quantity, min quantity, locked quantity, and is it deletable.  All child prices are rolled up to the package level to form the initial package cost.  A discount can be applied to the package to bring the cost of the package down.  As the package price is changed, the pricebook entry record for the package product changes too so that as users are browsing packages they will see the correct cost.  If the price of a child product is ever changed, then an apex job will detect the change and update packages that used that product.

Using Packages in Opportunities

When package products are added to opportunities, we have triggers that identify the products as package products and copy the package children into the opportunity.  We have overriden the Opportunity page with a visualforce page that displays the user’s normal page layout, but replaces the standard product list with a custom list that highlights the relationship of the child products to the parent products.  Users can discount the package in the opportunity if they want to offer clients discounts or they can delete products that are marked as deletable.  Multiple packages can be added to an opportunity and, if the parent product is deleted, then the entire package is deleted.

Force.com Enhanced Formula Editor Extension

This Google Chrome extension dynamically injects the Edit Area code editor into salesforce pages where formulas are edited.  Install the extension and when you visit a formula edit page it will automatically enhance the textarea.

Chrome Web Store Link

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.

https://github.com/kpeterson85/Salesforce-Enhanced-Formula-Editor-Chrome-Extension

Features

  • Syntax highlighting
  • Tabbing (tab and shift-tab)
  • Parenthesis matching
  • Find and Replace
  • No code wrapping
  • Resize editor window by clicking bottom right corner
  • Full screen feature

Downsides

  • No downsides!