Hi
We got a customer who wants a custom button on the form navigation which copies the link of the current record to his clipboard. How can I do this and is it supported? It's the new ms crm v9 On-Premise.
*This post is locked for comments
Hi
We got a customer who wants a custom button on the form navigation which copies the link of the current record to his clipboard. How can I do this and is it supported? It's the new ms crm v9 On-Premise.
*This post is locked for comments
Hi,
I hope this will help you.
1.Add button to CRM using Ribbon Workbench
2.Using following js code and Assign 'copyRecordUrl' to the button
function copyRecordUrl() {
var globalContext=Xrm.Utility.getGlobalContext()
var appUrl=globalContext.getCurrentAppUrl();
var id=Xrm.Page.data.entity.getId();
var url=appUrl+'&pagetype=entityrecord&etn=account&id='+id.slice(1,id.length-1);
var tempTag = document.createElement('textarea');
tempTag .value = url;
tempTag .setAttribute('readonly', '');
tempTag .style = {position: 'absolute', left: '-9999px'};
document.body.appendChild(tempTag );
tempTag .select();
document.execCommand('copy');
document.body.removeChild(tempTag );
}
Working with the clipboard from terms of supported/unsupported is falling to gray zone because usual approaches working with clipboard are implemented through DOM (and operations with DOM are considered as unsupported).
Article that Ambar provided will not work for latest Dynamics 365 for CE. You will have to write own code using following:
1. How to get proper url to record - docs.microsoft.com/.../open-forms-views-dialogs-reports-url
2. How to put string to clipboard - techoverflow.net/.../copying-strings-to-the-clipboard-using-pure-javascript
3. How to add button to CRM using Ribbon Workbench - ribbonworkbench.uservoice.com/.../71374-1-getting-started-with-the-ribbon-workbench
Good luck!
Hi
Thanks but is this supported?
Hi,
Go through with below article, hope it will help you .
https://ivobouwman.net/2011/01/05/copying-dynamics-crm-form-values-to-the-clipboard/
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
52
dkrishna
6