+ Start a Discussion

How to redirect back to Opportunity main page


I had to override a standard button in the Opportunity page by using the S-Control HTML. When clicking on this standard button, I wanted to popup a warning message to the users then redirected them back to the Opportunity main page after the users click on the OK button. Here are my codes:



<Script Language="Javascript">

function initPage() {
    var sURL = "/006/o";

    alert("Warning message");
    window.location = sURL;
<BODY onLoad=initPage()>


The system redirected the users back to the Opportunity main page but this Opportunity page was displayed inside the principal Opportunity main page. Could any expert tell me how to fix this redirecting issue?

Best regards!

Message Edited by boihue on 03-20-2009 08:14 AM
Best Answer chosen by Admin (Salesforce Developers) 


I found the solution by replacing the window.location with window.parent.location.href