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

Avoid URL parameter inline=1

I have a visualforcepage which is included in a layoutpage.

Viewlayout of this object has an override with another visual force page.


When I  call a pagereference methode from "inline" visualforcepage an try to leave the Iframe and load current objectpage again, salesforce creates a new URL with parameter inline=1.

By this parameter, Header and Sidebar is invisible. 



<apex:commandlink styleClass="btn newButton" style="text-decoration: none; margin: 2px !important;" value="Click" action="{!executeAction}" target="_parent">
pageRef = Page.NAME;
//pageRef = new ApexPages.StandardController(OBJECT).view();


 Is there a possibility to avoid getting parameter inline=1?


I tried:

  • new parameter inline=0
  • URL as a string
  • new redirect visualforce page


without success...



Does anybody has a solution for that?

@Salesforce: Any workarounds?

Vishal GuptaVishal Gupta
i suggest u to try inline=0 explicitly......otherwise i think there is no way.


I am having this same problem. Some info about the last suggestion (setting inline=0): it seems that the page will display inline if the 'inline' query attribute is present regardless of its value. In other words, both of these URLs will display a page inline:



It looks as if the only way to not display inline is to remoe the param altogether. Since it's added automatically by the platform, I don't know how to go about doing that. 


Here are some implementation details: 


The VF page that is displayed within the contact layout: 

<apex:page standardController="Contact" extensions="ProCaseContactController">
<apex:pageMessages ></apex:pageMessages>
<apex:pageBlock title="Pro Cases">
<apex:form >
<apex:commandButton action="{!editRemoteProCase}" value="Create Remote Pro Case"/>



The controller action for the page:


public with sharing class ProCaseContactController {


public PageReference editRemoteProCase() {
PageReference editPage = new PageReference(Page.ProCaseEdit.getUrl());
editPage.getParameters().put('object', 'Contact');
return editPage;


And the URL that is next shown is:



With the exception of not having the sidebar & header, the page displays and functions properly.


Any ideas on how to either remove the inline=1 param or refresh? I'm going to try adding a check for the parameter in the controller and then redirecting again but without the parameter if it's found. Very lame, though, since that requires a second server request..




Update: I tried redirecting with a removed 'inline' param, and it didn't work. What ended up happening was an endless redirection to the url *with* the inline=1 param included: 


public PageReference proCaseEdit() {
    Id id = ApexPages.currentPage().getParameters().get('Id');
    String objectType = ApexPages.currentPage().getParameters().get('object');
    String inline = ApexPages.currentPage().getParameters().get('inline');

    System.debug('%%%%%%%%%%%%%% inline param: ' + inline);


    if (inline != null) {
        PageReference editPage = new PageReference(Page.ProCaseEdit.getUrl());
        editPage.getParameters().put('object', objectType);
        editPage.getParameters().put('Id', id);


        System.debug('%%%%%%%%%%%% params: ' + editPage.getParameters());


        return editPage;



The log lines are: 


12:01:09.219 (219432000)|USER_DEBUG|[13]|DEBUG|%%%%%%%%%%%%%% inline param: 1


12:01:09.219 (219958000)|USER_DEBUG|[20]|DEBUG|%%%%%%%%%%%% params: {Id=003E000000FkegtIAB, object=Contact}


The upshot is that manually removing the inline parameter does not seem to work. 


Adding this js snippet just before the </apex:page> tag does the trick, but I'd love to hear a better solution: 


     var url = location.href;
     var match = url.match(/inline=1/);
    if (match != null) { 
        var newUrl = url.replace(/inline=1/, '');;



Marc C.Marc C.

if (location.href.match(/inline=1/)), '');



Thanks a Lot for the Workaround !!!

It works !! :)