You need to sign in to do that
Don't have an account?
Serena Schultz
Launch new visualforce page from custom button
Hi All,
I'm trying to upgrade a JavaScript button I have in Classic to work in Lightning. In Classic this JavaScript button opens a VisualForce page in a new window with some content populated based on the Parent page that the button is housed on. To migrate this to Lightning I've created a Detail Page Button which displays in a new window and calls a VisualForce Page.
The VF page that I'm calling opens the page I want just fine, but it is ALSO navigating me away from my parent Detail page (in this case contact).
Any thoughts on why? Code is below.
THANKS!
I'm trying to upgrade a JavaScript button I have in Classic to work in Lightning. In Classic this JavaScript button opens a VisualForce page in a new window with some content populated based on the Parent page that the button is housed on. To migrate this to Lightning I've created a Detail Page Button which displays in a new window and calls a VisualForce Page.
The VF page that I'm calling opens the page I want just fine, but it is ALSO navigating me away from my parent Detail page (in this case contact).
Any thoughts on why? Code is below.
THANKS!
<apex:page standardController="Contact"> <script> myFunction(); function myFunction() { if ({!NOT( ISNULL(Contact.MobilePhone) )}){ var url; if('{!$Label.AppName__namespace}' === "none"){ url="/apex/" + "SendMessage?contactIDs={!Contact.Id}"+"&contact=1&modal=1"; } else { url="/apex/" + '{!$Label.AppName__namespace__namespace}' + "SendMessage?contactIDs={!Contact.Id}"+"&contact=1&modal=1"; } window.open(url, 'Popup','height=510,width=1200,top=0,left=0,location=no,menubar=no,titlebar=no,toolbar=no,status=no'); } else{ alert ("Mobile Number Missing."); } } </script> </apex:page>