In past versions of CRM, retrieving a record's ID (GUID) was possible through a number of methods. In CRM 2013 these methods are somewhat limited and a work-around is necessary in order to easily obtain the GUID. I found that I primarily wanted to quickly copy the GUID of the record I was viewing. Based on my preference I researched a method which would allow me to easily find the GUID and also copy the value to the clipboard.
My solution involved creating a javascript bookmarklet. If you aren't familiar with javascript bookmarklets they are essentially bookmarks which contain jscript which will execute on the page you are viewing. A javascript bookmarklet can be created in IE, Chrome, or another browser of your choice.
- Create a new bookmark. I like to add the bookmark to my Favorites Bar in IE so that it is accessible.
- Find the newly created bookmark then right click and select Properties. On the General Tab rename the bookmark and call it "Retrieve GUID".
- Navigate to the Web Document Tab and delete the existing data in the URL field.
- Paste the following into the URL portion of the new bookmark:javascript:var guid=frames[0].Xrm.Page.data.entity.getId();var str1=guid.replace(/{/g,""); var copy=str1.replace(/}/g,"");(function(){window.prompt("Copy to clipboard: Ctrl+C, Enter", copy);})();
- Save your bookmark.
To test your new javascript bookmarklet, navigate to a single record in CRM and simply click your newly created Retrieve GUID bookmark. The following window will display when the bookmark is clicked while viewing a record in CRM:
by Customer Effective
Try changing the frames[0] to frames[1] - worked for me.
Cheers, Nigel
I want retrive GUID in MS EXCEL. can it possible?
When running on a specific account's page.
SCRIPT5007: Unable to get property 'entity' of undefined or null reference
main.aspx, line 1 character 1