You need to sign in to do that
Don't have an account?
How can I add a hyperlink to support normal and console view with hyperlink Javascript disabled
Hi, Javascript is blocked in hyperlink with Spring 2017. The problem I have is with an existing link that works for both normal and cosole view. Now, i'm not allowed to check for typeof(ScrUp); I'm not able solve this problem by creating an empty Visualforce page and an Apex controller followed by pass the required values from the link to controller, execute the logic to decide the URL in controller method and perform the redirect. The problem is that the new vf page itself opens in a new tab like a new window in both normal and console view. Please share your inputs on how I can fix this. Thanks
HYPERLINK("javascript:if(typeof(srcSelf)=='function'){srcSelf('/apex/pageName?isdtp=vw&Id="&Id&"');}"+"else{window.location.href='/apex/pageName?Id="&Id&"'}", "Friendly Name", "_target")
What action do I need to take?
Although JavaScript in hyperlink formula fields will continue to execute after the Spring ‘17 release, Salesforce recommends that admins begin reviewing their use of JavaScript in hyperlink formula fields and migrate to alternative solutions.
So it means it will still work at least till Winter '18 release and that's why it worked for me. However, I have to find an alternative solution soon. I'll keep you posted as soon as I find something.
Please update this thread if you find anything too.
HYPERLINK("/apex/pageName?isdtp=vw&Id="&Id, "friendly name", "_target").
I had to open the visualforce in the same tab, so used "_self".
This too works perfectly. Seems like we don't need the typeof(srcUp) function any more.
Note - Ensure that the url in the hyperlink has 'isdtp=vw'. This is required for the system to recognize that it is in console. Outside the console, it will try to remove the header, even if showHeader is marked as true in the visualforce page.