Many times when you are working with CRM it is usefull to be able to get the GUID of a record. It certainly makes my life alot easier when I can tell a coworker exactly which record I'm talking about, or when someone is testing they can give me the guid of the record that does not work.

There is a really simple way of getting the guid using a bookmark in your browser. Heres how to do it:

  1. Create a bookmark in your favorite browser.
  2. Name it "Show CRM GUID"
  3. Edit the properties, and paste the below javascript into the URL field.
javascript:!function(){var a=/id=([^&]+)/.exec(document.URL)[1],b=a?decodeURIComponent(a):"Could not find guid";window.prompt("Record ID:",b)}();

Now when you want the GUID of a crm record do this:

  1. Navigate to the record in CRM.
  2. Open it in a new window using the button in the top right.
  3. Click on the bookmark button you created above.

You should now get a popup with the GUID which looks something like this:

SmallImage

Also, if your interested, here is the unminified version of the javascript code.

javascript:(function() {
   var captured = /id=([^&]+)/.exec(document.URL)[1]; 
   var result = captured ? decodeURIComponent(captured) : 'Could not find guid';
   window.prompt('Record ID:',result);
})();

If your are still using CRM 2011 use this code instead:

javascript:(function() {var url=document.URL;var guid = url.search(/id(%)3d(%)257b[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-Z0-9]{12}/);window.prompt('Record ID:',url.substring(guid+10, guid+46))})();

Unminified: 

javascript:(function() {
  var url=document.URL;
  var guid = url.search(/id(%)3d(%)257b[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-Z0-9]{12}/);
  window.prompt('Record ID:',url.substring(guid+10, guid+46))
})();