0

I have a Visualforce page with a custom button that calls JavaScript to execute a script. When I click the button, I get a 404 Error (Not Found) error. Apparently, this is due to an SFDC resource called "logo180.png". It seems this is a known issue that occurs by design to prevent malware. However, it prevents by button from working on my VF page. Does anyone know how I can avoid this?

<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_First_Name__c)};LastName~{!JSENCODE(Engage_Short_Form__c.Partner_Contact_Last_Name__c)};Role~Signer1,[email protected];FirstName~John;LastName~Neilan;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 >

            <center><button class="btn" onclick="sendViaDocuSign()">Send via DocuSign</button></center>
7
  • Looks like there is a quotation mark issue in the line of code where you are setting window.location.href
    – Phil Rymek
    Dec 1, 2015 at 20:04
  • Thanks, missed that, but I'm still getting the same resource error.
    – J. Neilan
    Dec 1, 2015 at 20:08
  • What makes you think that logo180.png is causing a problem with your window.location.href call? Is it just appearing as a failed request in the developer tools, or is it directly related to the location change? By Known Issue I assume you are referring to Salesforce can not find /17181/logo180.png Dec 1, 2015 at 20:27
  • are you directy able to access "/apex/dsfs__DocuSign_CreateEnvelope" from same page where you are clicking button ? Dec 1, 2015 at 20:27
  • 1

1 Answer 1

1

Thanks everyone. I figured out if I added return false; to my onClick, the button works! Thanks for all your help!

<button class="btn" onclick="sendViaDocuSign();return false;">Send via DocuSign</button>
1
  • I'd suggest you change the title of your post as the issue is more related to the onclick javascript code than the 404 which is a red herring.
    – cropredy
    Dec 2, 2015 at 1:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .