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 }
ricktorious
/ July 30, 2012Any way that you know of to reference the Object ID for custom objects in a bookmarklet?
Kyle Peterson
/ July 31, 2012I don’t understand the issue you are working on. Do you want to share some example URLs and clarify what you want to grab from them?
ricktorious
/ August 2, 2012I’m probably a little off base but is there any way to either A.| run a SOQL query and return the results using javascript inside of a bookmarklet? (ex: SELECT ID FROM Account where Name = XYZ Corp. and then use that ID inside of the bookmarklet) B.| Simply merge a field from a given page into a bookmarklet?
Kyle Peterson
/ August 4, 2012You can use a bookmarklet to grab content from the page and do things with it if that’s what you’re referring to.