You need to sign in to do that
Don't have an account?
gsickal
Open custom link in same window?
How do I get a custom link to open up in the same window it was launched from? Normally when I click on a custom link, it opens up the code it calls in a completely new salesforce window that is identical to the source window except for the new context in the iframe...
Code:
Excellent suggestion. But my custom link did reference an scontrol and everything works nicely when the custom link is clicked from within the "Custom Links" part of the detail page. The problem is I have created a formula field so that this custom link appears conditionally in a new section of the layout I created called "Actions". The formula field looks at the value of a dropdown, and if it is a certain value then it displays the custom link; otherwise it hides it. Here is the formula field where the link id below ("00b30000000vyG9") is the id of my custom scontrol:
IF (AND (NOT{!Non_Standard__c}, ISPICKVAL({!Status__c}, "Request")), HYPERLINK("/servlet/servlet.Integration?lid=00b30000000vyG9"&"&eid="&{!Id}, "View Draft"), NULL)
I think maybe that the problem is the Hyperlink function above always creates a new salesforce window when what I really want is to have the content of my scontrol (which I specified to open in a salesforce iframe) open in the same window, not a new one... Is there any way to get this to open in the same window using a formula field like the one described above? If not, is there any way to have a regular custom link appear conditionally based on some condition? Thanks
I think you are correct in your assumption. The HYPERLINK function opens in a new window. Custom links cannot appear conditionally and they also must be contained in their own specific page layout section.
ok, this is what I was afraid of... Thanks very much for your help.
To summarize this for others who might be helped by this, custom links cannot be conditional, but the advantage of them is they can open up in the same window. To make them "conditional", you can use a formula field to conditionally hide or show them, but when you do this, they will always open up in a new window since the Hyperlink command (which is the link type field currently available for formula fields) always opens a new window.
HYPERLINK() formula function does not accept any normal browser window open arguments, and always opens a popup.
there is a feature request to provide control over this window open operation.
HYPERLINK(link, text, '_self')
http://boards.developerforce.com/t5/General-Development/Help-with-HYPERLINK-formula-field/td-p/75306
Use _Self.
https://www.youtube.com/watch?v=UJzFmBmdS8M