You need to sign in to do that
Don't have an account?
rcher
Java script function not executing from a visualforce page
Hi,
I have a javascript function inside a visualforce page, the function is not getting executed on click of a button Let me know what the issue could be.
<apex:page standardController="Quote"> <style type="text/css"> .buttonDiv { padding-left: 115px; /*attempts to indent the button to better align within the standard page layout*/ } </style> <div class="buttonDiv"> <input class="btn" name="demo_button" onclick="Quote_To_CW()" title="Quote To CW" type="button"/> </div> <script src="/soap/ajax/33.0/connection.js"></script> <script> function Quote_To_CW(){ var sync = '{!Quote.IsSyncing }' var conversion = '{!Quote.Conversion_Status__c}' if( sync == false) { alert("Please sync your quote before continuing"); } else if( conversion == 'Sent') { alert("Your Quote has already been sent to CW"); } else { var r = confirm("Note that you can only send Quote to CW one time. Are you sure you want to send?"); } if(r==true) { var quoteID = '{!Quote.Id}' postParams = {} postParams.url = 'https://servicesuat.com:10000/QuoteToCW/' + quoteID postParams.method = 'GET' postParams.requestHeaders = {} postParams.requestData = '' postParams.requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded' //or another mime-type postParams.requestHeaders['Content-Length'] = postParams.requestData.length //required for POST postParams.onSuccess = processSuccess postParams.onError = processError sforce.connection.remoteFunction(postParams) function processSuccess(message) { // do something with results¨ alert("Quote has been synced to CW, don't click the Quote>CW Button Again. This page will now redirect"); ///window.location.href= "{'/006/o'}"; } function processError(message) { // do something with the error alert('error'); } } } </script> </apex:page>
I have a javascript function inside a visualforce page, the function is not getting executed on click of a button Let me know what the issue could be.
<apex:page standardController="Quote"> <style type="text/css"> .buttonDiv { padding-left: 115px; /*attempts to indent the button to better align within the standard page layout*/ } </style> <div class="buttonDiv"> <input class="btn" name="demo_button" onclick="Quote_To_CW()" title="Quote To CW" type="button"/> </div> <script src="/soap/ajax/33.0/connection.js"></script> <script> function Quote_To_CW(){ var sync = '{!Quote.IsSyncing }' var conversion = '{!Quote.Conversion_Status__c}' if( sync == false) { alert("Please sync your quote before continuing"); } else if( conversion == 'Sent') { alert("Your Quote has already been sent to CW"); } else { var r = confirm("Note that you can only send Quote to CW one time. Are you sure you want to send?"); } if(r==true) { var quoteID = '{!Quote.Id}' postParams = {} postParams.url = 'https://servicesuat.com:10000/QuoteToCW/' + quoteID postParams.method = 'GET' postParams.requestHeaders = {} postParams.requestData = '' postParams.requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded' //or another mime-type postParams.requestHeaders['Content-Length'] = postParams.requestData.length //required for POST postParams.onSuccess = processSuccess postParams.onError = processError sforce.connection.remoteFunction(postParams) function processSuccess(message) { // do something with results¨ alert("Quote has been synced to CW, don't click the Quote>CW Button Again. This page will now redirect"); ///window.location.href= "{'/006/o'}"; } function processError(message) { // do something with the error alert('error'); } } } </script> </apex:page>
vigneshwar kotha