web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Custom Button to Copy record link to clipboard

(0) ShareShare
ReportReport
Posted on by 196

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

I have the same question (0)
  • Suggested answer
    gupta.ambar2009@gmail.com Profile Picture
    797 on at

    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/

  • Manuel Steiner Profile Picture
    196 on at

    Hi

    Thanks but is this supported?

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    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!

  • Suggested answer
    Community Member Profile Picture
    on at

    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 );

    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans