JavaScript Bookmark Series – Part 2

Posted by on August 17, 2012  |  commentsComments (1)

A lot of times you’ll find yourself in need of an ID for a certain record.  You can navigate to that record in CRM and copy and paste the ID out of the URL but that can be a pain due to encoding. 

Here’s a quick and easy bookmark you can set up to alert the record ID and have it copied into your clipboard automatically:

javascript: var id = frames[0].Xrm.Page.data.entity.getId();  if (id) { clipboardData.setData("Text", id.toString()); alert(id); } else { alert('No id yet!'); }

And another one for the entity type code as a bonus…

javascript: var typeCode = frames[0].Xrm.Page.context.getQueryStringParameters().etc; if (typeCode) { clipboardData.setData("Text", typeCode.toString()); alert(typeCode); }

Enjoy!

Comments

  1. A lot of times you’ll find yourself in need of an ID for a certain record. You can navigate to that record in CRM and copy and paste the ID out of the URL but that can be a pain due to encoding.

    Posted by: Tamatha Lira  |  Sep 24, 2012 6:05:55 AM

Post a Comment

  • *Required

Contact Us for a Quote, or Personalized Demonstrationof Microsoft Dynamics CRM for Your Business.

Contact Us