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
sfg1sfg1 

Redirecting to tab from visualforce page

Onclicking button i want to redirect to custom tab from my visualforce page. My custom tab URL "https://cs68.salesforce.com/a23/o". Please guide me.
Raj VakatiRaj Vakati

Here is the code. Get the Tab URL dynamically by using dynamic apex 
 
<apex:commandButton action="{!redirect}" value="redirect"/>
  Controller logic 
   public PageReference cancel()
     {
     PageReference home = new PageReference('/a23/o');
     home.setRedirect(true);
     return home;
     }


 
sfg1sfg1
Thanks for your reply Raj. I have placed my visualforce page(VFpage1) in another visualforce page(VFpage2) using IFRAME. The code is working in  VFpage1, it is redirecting to custom tab. But when i click from VFpage2 it is not working. Can you please help in this. please find my code.
          <apex:commandButton action="{!manageSObjectOne}" value="redirect"/>
Controller logic:
   public PageReference manageSObjectOne() {
        PageReference prRef = new PageReference('/a23/o');
        prRef.setRedirect(true);
        return prRef;
        
    }