Every entity record in Dynamics CRM has a Guid assigned to it. The field (aka attribute) that holds the guid is EntityLogicalNameid. For example, account is accountid
and a custom entity with named new_customentity would have a field called new_customentityid.
During the create process of a new record Dynamics CRM will generate a sequential id for the record. Note: You can specify the id for calls made through the SDK but this is not recommended as it will be a break in the sequence.
This value is not displayed directly on the UI. It can be retrieved via JavaScript by calling Xrm.Page.data.entity.getId()
.
So knowing that if we want to get the Id of a record you can save the following snippet to a JavaScript WebResource file in Dynamics CRM and register the event DisplayEntityId
as an OnLoad function. When the entity is opened it will display an alert box with the entity record's unique id. This of course is just for a proof-of-concept as it would cause serious usability concerns.
function DisplayEntityId() {
alert(Xrm.Page.data.entity.getId());
}
There is another method to use JavaScript through the browser URL. Open the desired record in Dynamics CRM (and it must be an actual record - not a view, dashboard, etc.) and paste the following into the browser URL. Press Enter and viola the entity record's unique ID will be available for copying.
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);})();
Be sure to scroll right to get the entire snippet.