You need to sign in to do that
Don't have an account?
Frank Carter
vf page/ javascript - return previous page
Hello,
I need help.
I have a custom button on Opportunity record page that opens a vf page with inline Javascript code. I want to know if there is an instruction like "window.location.href = " or similar to make me go back to previous page (valid for Classic and Lightning). The previous page is a page of an opportunity.
Thanks,
Frank
I need help.
I have a custom button on Opportunity record page that opens a vf page with inline Javascript code. I want to know if there is an instruction like "window.location.href = " or similar to make me go back to previous page (valid for Classic and Lightning). The previous page is a page of an opportunity.
<apex:page standardController="Opportunity" > <script type = "text/javascript"> window.onload=function() { if(('{!Opportunity.StageName}' != "Won"){ window.location.href = '/apex/Involve_PreSales?Id={!Opportunity.Id}'; } else alert("The PreSales has already been involved"); //GO TO PREVIOUS PAGE; } }; </script> </apex:page>Can some one help me?
Thanks,
Frank
Raj Vakati
try this code