", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4LuoSAF", "datePublished": "2015-12-01T17:28:43.000Z", "author": { "@type": "Person", "name": "John Neilan", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000BMmXOAA1", "affiliation": { "@type": "Organization", "name": "Outbrain" } } } ] } } Skip to main content
John Neilan (Outbrain) 님이 #Visualforce에 질문했습니다
Does anyone know how to debug a Comandbutton in a VF page?  I have a page that has a JavaScript script with a window.location.href element.  The Commandbutton is mean to call this script and direct the user to the URL in the href element.  Everythign save properly, but all the button does when pressed is refresh the page.  Does anyone know how I can figure out what is actually happening when I press the button and why it's not calling the window.location.href element of the script?
답변 2개
  1. 2015년 12월 1일 오후 5:28
    Thanks for the clarification.  I don't have a custom controller on the page.  Is there anything I can change to get it to execute?

     

    <apex:page standardController="Engage_Short_Form__c">

    <script type="text/javascript" src="/apex/dsfs__DocuSign_JavaScript"></script>

    <script type="text/javascript">

    function sendViaDocuSign() {

    var CRL = '';

    var DST = '';

    var CES = '';

    CRL = 'Email~{!JSENCODE(Engage_Short_Form__c.Partner_Email__c)};FirstName~{!JSENCODE(Engage_Short_Form__c.Partner_Contact__r.FirstName)};LastName~{!JSENCODE(Engage_Short_Form__c.Partner_Contact__r.LastName)};Role~Signer1,Email~jneilan@outbrain.com;FirstName~Test;LastName~Test2;Role~Signer 2';

    DST = '0E9AB63C-62C0-4D01-B91A-E58849B7B573';

    CES = 'Insertion Order signature request for {!JSENCODE(Engage_Short_Form__c.Partner_Legal_Name__c)}';

    window.location.href = '"/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&STB=1&SourceID={!Engage_Short_Form__c.Id}&LA=0&CRL="+CRL+"&DST="+DST+"&CES="+CES';

    }

    </script>

    <apex:form >

    <apex:commandButton value="Send For Signature" onclick="sendViaDocuSign()"/>

     

0/9000