You need to sign in to do that
Don't have an account?
d.tejdeep@nicomatic.in
onclick javascript button to visaulforce page button lightning
salesforce classic onclick javascript button code :
I can able to show this button in lightening in salesforce .
But I cant see any alert messages ,when i click on the button .it is blank pop up opening.
{!REQUIRESCRIPT("/soap/ajax/34.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/34.0/apex.js")} var connection = sforce.connection; var qid="{!Quote__c.Id}"; var isedit="{!Quote__c.isEdited__c}"; var isPreviewed="{!Quote__c.isPreviewd__c}"; var isGenerated="{!Quote__c.Generated__c}"; var pot="{!Quote__c.potential__c}"; var x=pot.replace(/\,/g,''); var quot= new sforce.SObject("Quote__c"); quot.id=qid; if(isGenerated==true && isPreviewed==false){ alert('Please preview the quote then generate '); } else if(isedit==true && isPreviewed==false){ alert('Please preview the quote then generate '); }else{ parent.location.href = parent.location.href; window.open("/apex/QuotePDF?id={!Quote__c.Id}","_blank"); if(x>50000){ if (('{!$User.ProfileId}'=='00e90000000emPJ') || ('{!$User.ProfileId}'=='00e90000001k992' )){ alert('Please print the quote for manager signature'); }} }visual page button code :
<apex:page standardController="Quote__c"> <apex:includeScript value="../../soap/ajax/34.0/connection.js"/> <apex:includeScript value="../../soap/ajax/34.0/apex.js"/> <script> sforce.connection.sessionId='{!GETSESSIONID()}'; var qid="{!Quote__c.Id}"; var isedit="{!Quote__c.isEdited__c}"; var isPreviewed="{!Quote__c.isPreviewd__c}"; var isGenerated="{!Quote__c.Generated__c}"; var pot="{!Quote__c.potential__c}"; var x=pot.replace(/\,/g,''); var quot= new sforce.SObject("Quote__c"); quot.id=qid; if(isGenerated==true && isPreviewed==false){ alert('Please preview the quote then generate '); } else if(isedit==true && isPreviewed==false){ alert('Please preview the quote then generate '); }else{ parent.location.href = parent.location.href; window.open("/apex/QuotePDF?id={!Quote__c.Id}","_blank"); if(x>50000){ if (('{!$User.ProfileId}'=='00e90000000emPJ') || ('{!$User.ProfileId}'=='00e90000001k992' )){ alert('Please print the quote for manager signature'); }} } </script> </apex:page>
I can able to show this button in lightening in salesforce .
But I cant see any alert messages ,when i click on the button .it is blank pop up opening.