function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

returning a PageReference from Controller and Salesforce appends ?inline=1 to the URL

Hello All,


I have a custom page and controller.  I am trying to do some error handling within the controller as such:


public PageReference sendMail2PM(){

string PMID = [select Deliverable_Owner__c from P4_Contract_Deliverable__c where id =].Deliverable_Owner__c;


string PMEmail = [select email from contact where id=:PMID].email;


    PageReference errorPage = new PageReference('');
    return errorPage;




My problem is that when the redirect happens, somehow "inline=1" gets appended to the URL.  It seems that when the inline parameter is present then the page renders without headers or sidebars.  I want the header and sidebar so users know they are still in saleforce.


Where is the "inline=1" coming from and how do I get rid of it?  Or else how do I make the redirect happen with headers and sidebars?


I don't know the specifics to the "inline=1" parameter, but if you want to enforce the standard header and sidebar, make sure your apex page is defined as follows:


<apex:page showHeader="true" sideBar="true" .../> ... </apex:page>




Also, I notice you hardcode the URL "". That will only work when in a Sandbox environment. You should use relative URL such as:

PageReference errorPage = new PageReference('/apex/errorLanding');



Message Edited by aalbert on 02-05-2009 08:37 AM
Alas, I tried the sidebar="true" and showHeader="true", but they still do not appear.

Why do you have to do a redirect?


Couldn't you just




    PageReference errorPage = Page.errorLanding;
    return errorPage;



Granted, the URL in the browser taskbar is not updated ... but if you can live with that.

Thanks Lamayc, I tried that method but unfortunately I still have the same issue.  I ended up putting in a call to SF support, so hopefully I will have it resolved soon.  Thanks for your help.

(''); instead of this use it


('../apex/errorLanding');you will get current page.


Hello Frodo,


Have you get any solution for this issue? If yes, could you please let me the solution.


Ron WildRon Wild

You might try the following:



PageReference pageRef = new PageReference('/'+this.selectedAccount); pageRef.setRedirect(true); pageRef.getParameters().put('inline','0'); return pageRef;


 You'll end up with something like this...


... which will negate the inline=1 for you.


- R



I realize this is an old post....but has anyone found a solution to removing the inline=1 parameter? 






 only results in a douplicat param in the url so it looks like:





I did find that if you switch the button/link to an outputlink it wont put that in url and will redirect to the page fine. You may just need to add action support to the link depending on what you are trying to do.


I have this working on many pages in many different ways so i know its posssible, but you just need to not use a commandlink/button

for example this button is in the case view:

<apex:outputpanel id="fullsearchbuttonpanel">

<apex:actionRegion id="FullSearchActionRegion">

<apex:outputLink id="btnFullSearch1" styleClass="btn fullsearchbutton" style="text-decoration: none;" value="{!fullSearchUrl}" target="_top" >

<apex:actionSupport event="onClick" action="{!getfullSearchUrl}" status="workstatustwo" />
Full Search



and the controller:

public string userKeywords{get;set;}

public PageReference getfullSearchUrl(){
string kywrds = this.userKeywords;
if(kywrds == NULL || kywrds == ''){kywrds = cse.Subject;}
kywrds = EncodingUtil.urlEncode(kywrds, 'UTF-8');
PageReference ref = new PageReference('/apex/knowledge' + '?product=' + cse.ccil_product2__c + '&id=' + '&keywords=' + kywrds );
return ref; }


since this is a controller extention for case the 'cse' is refrincing that... but its not inportant for what you are tying to do. Just wanted to show an example of it working.


Ted LangTed Lang

it works. you help me a lot.


Thanks a lot..........

I got it.........

Mahmoud AbdelsalamMahmoud Abdelsalam

I tried the following and it is working as expected 

But this mark up in the Component 

    <a href="javascript:void(0);" onclick="{!c.gotoURL}"  >Link Title</a>

and this function inside the jsController        

 gotoURL : function(component, event, helper) { 
         var ctarget = event.currentTarget;
        var id_str = ctarget.dataset.value;
        var urlEvent = $A.get("e.force:navigateToURL"); 
        urlEvent.setParams({ "url":"/apex/VisualForcePageName")});;