www.webdeveloper.com
Results 1 to 2 of 2

Thread: Copy fields into clipboard

  1. #1
    Join Date
    Sep 2011
    Posts
    1

    Copy fields into clipboard

    hi there,

    i dunno if there is any thread like this in that forum.
    Im new to Javascript developing, so im not a wizard or something...

    I working with the salesforce platform, and there i want to add a button to copy some fields like "Billing address and the name" from the Account object into the clipboard. I set the browserpermissions to "true", but my script does nothing..

    Salesforce syntaxcheck displays no errors..

    maybe i get here some help for my little problem..


    Code:
    {!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js") };
    
    
    
    bBool=false
    var copiedtext= ""
    var tempstore=""
    
    
    function initiatecopy() {
    bBool=true;
    }
    
    function copyit() {
    if (bBool) {
    tempstore=copiedtext
    document.execCommand("Copy")
    copiedtext=window.clipboardData.getData (sforce.connection.retrieve ("BillingAddress, Name" , "Account", ["{!Account.Id}"]) );
    if (tempstore!=copiedtext) {
    alert(copiedtext);
    }
    bBool=false;
    }
    }
    
    document.onselectionchange = initiatecopy
    document.onklick = copyit

  2. #2
    Join Date
    Feb 2012
    Posts
    1
    I am facing a similar issue with no success (yet). Did you ever get this working by chance?

    Any help would be greatly appreciated!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles