You need to sign in to do that
Don't have an account?
sarac
Custom button/s-control renders in hover box when pressed! Help...
Hello,
I have a number of custom "New" buttons which are located on a related list (of Opportunities) in the Contact record. The buttons are S-control buttons and are set to render in the same window with a side bar.
They work fine off of the related list - they just bring up a pre-populated opportunity record type. However, when you hover over the related list at the top of the Contact record and push one of the buttons, it renders the new page in the hover box!
Any help here?
Thanks!
Sara
Update: I have compared this custom button/s-control with another that comes with the non-profit template (both create membership opportunity records from a Contact and both are located on the opportunity related list in the contact record) and does NOT render in the hover when pressed, and they are *identical*. Same exact button attributes, and the S-control's Javascript is the same as well. This is a big problem for our client - I am thinking it must be a configuration issue. ?
Message Edited by sarac on 04-23-2008 12:09 AM
I have a number of custom "New" buttons which are located on a related list (of Opportunities) in the Contact record. The buttons are S-control buttons and are set to render in the same window with a side bar.
They work fine off of the related list - they just bring up a pre-populated opportunity record type. However, when you hover over the related list at the top of the Contact record and push one of the buttons, it renders the new page in the hover box!
Any help here?
Thanks!
Sara
Update: I have compared this custom button/s-control with another that comes with the non-profit template (both create membership opportunity records from a Contact and both are located on the opportunity related list in the contact record) and does NOT render in the hover when pressed, and they are *identical*. Same exact button attributes, and the S-control's Javascript is the same as well. This is a big problem for our client - I am thinking it must be a configuration issue. ?
Message Edited by sarac on 04-23-2008 12:09 AM
Please post back if you've found a solution to this.
i'll let you guys know if I come up with something.
This doesn't work with related list hovers though it works normally. To fix it, change it to JavaScript, and do this:
You should be able to work around any type of URL problem using this simple JavaScript syntax. You can also open your S-Controls using URLFOR and this JavaScript, although your milage may vary. Alternatively, you can use a "breakout" script inside the s-control itself, as follows:
Include this code anywhere in your S-control's initialization scripts, and it will break out of whatever frames it might be placed in in this or any future release. This might be undesirable if you're trying to get your S-Control to appear inside tabs, though.
Unfortunately one can not use the URLFOR method if any of the queryparameter names are salesforce IDs (which a few of ours are due to how Salesforce names custom field input parameters). This is a post I wrote a while back, which was a disappointment to say the least!
I have been using the top reference in Javascript which only partially works - if you click the button in the hover, but then move the mouse off of the hover before the next page renders (not hard to do) then nothing renders. This is not the case for built in Hover buttons. Someone was looking into this issue, but I never heard anything back.
Thanks for your input,
Sara
Found Issue replication link : https://success.salesforce.com/issues_view?id=a1p30000000T3ttAAC
if(window.top.location.href != window.location.href)
{
//alert('hover window button clicked');
parent.location.href = openUrl;
}
else
{
//alert('related list button clicked');
window.open(openUrl,'_self'); // _self opens VF page in the same tab
}
You can add alerts to see the values :-
alert('window.top.location.href is ' + window.top.location.href);
alert('window.location.href is ' + window.location.href);
They are different when the button is clicked in the hover window itself on the Contacts link on an account's detail page.
Detailed description :-
Suppose you have created a custom button on Contact called as "Search more contacts" of type related list button that will execute Javascript from Setup -> Customize -> Contacts -> Buttons, Links, and Actions -> New Button [Type = List Button, Behavior = Execute JavaScript]
This button will open a new Visualforce page called vfSearchMoreContacts.
If you hover on the Contacts link at the top of an account record and click on this button in that hover window itself, it will open the Visualforce page to be opened in that hover window itself. To open it in current tab, use code given above.