Monday 18 March 2013

Hiding header and Sidebar in Salesforce


some times we need to hide header and sidebar of a visualforce page or standard layout.
we can do it by writing showheader = "false"  and sidebar = "false" in the visualforce page.

for example 
<apex:page controller = "TestController"  showheader = "false" sidebar = "false">
   // your information 
</apex:page>

How can we hide in header and sidebar standard layout ?
ans- Salesforce is user friendly language, There is also a feature available so called "Enable Collapsible Section", By using this we can only hide sidebar
you can go in this way Name-->set up-->customize--> user interface--> checked the check box "
Enable Collapsible Section", after that you can show or hide sidebar.

If someone wants to hide both sidebar and header of standard layout, then how will we do it? 
Ans- It is very simple, just append "isdtp = vw" at end of link in the URL, you will see the magic.

Also you can write this in apex code.for example

PageReference samepage= new PageReference('/apex/pagename?recordid&isdtp=vw);
For testing you can write "isdtp = vw" in the any standard layout, It will automatically hide header and sidebar, Try It 


5 comments:

Gayatri Challa said...

Awesome Asish!!

Gayatri Challa said...

Awesome post:)

Asish Kumar Behera said...

Thanks Gayatri.. :)

Unknown said...

I have checked this in the below link

https://instance.salesforce.com/recordid&isdtp=vw

And I got the error as URL doesn't exist.

Unknown said...


Great Article. it is very very helpful for all of us and I never get bored while reading your article because they are becomes a more and more interesting from the starting lines until the end.

SalesForce online training