• AparnaUpadhayay
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hi,

 

I have a requirement in which my VF page will be redirected according to the record types. I was able to do this, but my VF page is not working now. I am using Tabbed functionality in VF page. And after redirection, tabs are not working. Any idea what should be done?

 

My VF page is: 

 

<apex:page sidebar="true" standardController="Opportunity" tabStyle="Opportunity" extensions="OpportunityRedirectExtension"
action="{!nullValue(redir.url, urlFor($Action.Opportunity.View, opportunity.id, null, true))}">

<style>
.activeTab {background-color: rgb(23, 151, 192); color:white; background-image:none}
.inactiveTab {background-color: lightgrey; color:black; background-image:none}
</style>

<apex:tabPanel switchType="client" tabClass="activeTab" inactiveTabClass="inactiveTab" >
<apex:tab label="Opportunity">
<apex:detail relatedList="true" relatedListHover="false"/>
</apex:tab>
<apex:tab label="Financial Summary">
<apex:pageBlock mode="maindetail" tabStyle="Opportunity" title="Financial Summary">
<apex:pageBlockButtons location="Top">
<apex:form >
<apex:commandButton action="{!edit}" value="Edit" />
<apex:commandButton action="{!delete}" value="Delete"/>
</apex:form>
</apex:pageBlockButtons>

<apex:pageBlockSection title="Deal Revenue" collapsible="true">
<apex:pageBlockSectionItem >
<apex:outputLabel value="Total Deal Value GP" />
<apex:outputLabel value="" />
</apex:pageBlockSectionItem>
<apex:outputField value="{!opportunity.Revenue_Type__c}"/>
<apex:outputField value="{!opportunity.Annual_Recurring_Revenue__c}"/>
<apex:outputField value="{!opportunity.Revenue_Value__c}"/>
<apex:outputField value="{!opportunity.NX_MRR__c}"/>
<apex:outputField value="{!opportunity.Total_Order_Revenue__c}"/>
<apex:outputField value="{!opportunity.GDO_Offering_Value__c}"/>
<apex:outputField value="{!opportunity.Total_Install_Revenue__c}"/>
<apex:outputField value="{!opportunity.NRR__c}"/>
<apex:pageBlockSectionItem />
</apex:pageBlockSection>
<apex:pageBlockSection title="Commissionable Revenue" collapsible="true">
<apex:outputField value="{!opportunity.Base_ARR__c}"/>
<apex:outputField value="{!opportunity.Total_Commisions__c}"/>
<apex:outputField value="{!opportunity.Incremental_ARR__c}"/>
<apex:outputField value="{!opportunity.NX_ARR__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Contract Information" collapsible="true">
<apex:outputField value="{!opportunity.GDO_Primary_Offering__c}"/>
<apex:outputField value="{!opportunity.Validation_Failure_Reason_s__c}"/>
<apex:outputField value="{!opportunity.Contract__c}"/>
<apex:outputField value="{!opportunity.Delivery_Organization__c}"/>
<apex:outputField value="{!opportunity.Contract_Length_No_of_Months__c}"/>
<apex:outputField value="{!opportunity.Delivery_Team__c}"/>
<apex:outputField value="{!opportunity.DRP_Deal_Name__c}"/>
<apex:pageBlockSectionItem />
<apex:outputField value="{!opportunity.EPS_Model__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:tab>
<apex:tab label="Xerox Offering">
<apex:relatedList list="OpportunityLineItems" />
<apex:relatedList list="Equipment_Data__r" />
<apex:relatedList list="VQX_Import_Object__r" />

</apex:tab>
<apex:tab label="Activities / Milestones">
<apex:relatedList list="OpenActivities" />
<apex:relatedList list="ActivityHistories" />
</apex:tab>
<apex:tab label="Synergy">
<apex:pageBlock mode="maindetail" tabStyle="Opportunity">
<apex:pageBlockSection title="Synergy Detail" collapsible="true">
<apex:outputField value="{!opportunity.Primary_Synergy_Leveraged__c}"/>
<apex:outputField value="{!opportunity.User__c}"/>
<apex:outputField value="{!opportunity.Originator_Email__c}"/>
<apex:outputField value="{!opportunity.Relationship_Status__c}"/>
<apex:outputField value="{!opportunity.ACS_Delivery_Groups__c}"/>
<apex:outputField value="{!opportunity.Suggested_NRR__c}"/>
<apex:outputField value="{!opportunity.Suggested_ARR__c}"/>
<apex:outputField value="{!opportunity.ACS_Lead__c}"/>
<apex:outputField value="{!opportunity.ACS_Sales_Lead_Email__c}"/>
<apex:outputField value="{!opportunity.Cross_Sell_Qualified__c}"/>
<apex:outputField value="{!opportunity.Cross_Sell_Deal__c}"/>
<apex:outputField value="{!opportunity.Cross_Sell_Lead__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:tab>
<apex:tab label="Alliance">
<apex:pageBlock mode="maindetail" tabStyle="Opportunity">
<apex:pageBlockSection title="Alliance Detail" collapsible="true">
<apex:outputField value="{!opportunity.Alliance_Comments__c}"/>
<apex:outputField value="{!opportunity.Alliance_Mgmt_Close_Date_Forecast__c}"/>
<apex:outputField value="{!opportunity.Alliance_Partner_Type__c}"/>
<apex:outputField value="{!opportunity.Forecast_by_Alliances_Mgmt__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:tab>
</apex:tabPanel>

</apex:page>

 

And Controller is:

 

public class OpportunityRedirectExtension {
public OpportunityRedirectExtension(ApexPages.StandardController controller) {
this.controller = controller;
}

public PageReference getRedir() {
Opportunity opp = [Select id, recordtypeid From Opportunity Where Id = :ApexPages.currentPage().getParameters().get('id')];
PageReference newPage;

if (opp.recordtypeid == '0122000000095ne') {
newPage = new PageReference('/apex/MyOpportunity?id='+opp.id+'&sfdc.override=1');
}
else{
newPage = new PageReference('/' + opp.id);
newPage.getParameters().put('nooverride', '1');

}
newPage.getParameters().put('id', opp.id);
return newPage.setRedirect(true);
}

private final ApexPages.StandardController controller;
}

 

 

This is an urgent requirement. 

I am trying to bulid a tabbed page using TabPanel control. For each tab I have few fields as well few buttons. Say I have a button called edit at Tab 3, When I click the button it refreshes the page and puts me on the Tab 1 rather than Tab 3. I would like to know this is how the Tab panel behaves or I am doning nothing wrong.
So I looking for the solution for this to fix or any work around for this(Like getting tab id from page to controller)

Please provide me a better solution for this.

 

Thanks in advance.

Saravanan

 

I have a VF page with a standard controller and extension controller.  I'm using the tabPanel and tab controls, but the tabs do not display (only the text of the tab) and you can't click on the text of the tab to move from one tab to another.

 

Page:

 

<apex:page standardController="Lead" extensions="DispatcherLeadViewController" action="{!nullValue(redir.url, urlFor($Action.Lead.View, lead.id, null, true))}" showHeader="true" tabStyle="lead">
    <apex:tabPanel switchType="client" selectedTab="name1" id="theTabPanel">
        <apex:tab label="One" name="name1" id="tabOne">
        	<apex:outputField value="{!Lead.FirstName}" />
        </apex:tab>
        <apex:tab label="Two" name="name2" id="tabTwo">
        	<apex:outputField value="{!Lead.LastName}" />
        </apex:tab>
    </apex:tabPanel>
</apex:page>

 

controller:

 

public class DispatcherLeadViewController {
	
	private final ApexPages.StandardController controller;
	
	public DispatcherLeadViewController(ApexPages.StandardController controller) {
		this.controller = controller;
	}
	
	public PageReference getRedir() {
 
		Lead l = [Select id, recordtypeid From Lead Where Id = :ApexPages.currentPage().getParameters().get('id')];
 
		PageReference newPage;
 
		if (l.recordtypeid == '012400000005S9QAAU') {
			system.debug('We are here');
			newPage = Page.LeadViewTabbed;
			system.debug('************************* ' + newPage);
		} else {
			newPage = new PageReference('/' + l.id);
			newPage.getParameters().put('nooverride', '1');
		}
 
		newPage.getParameters().put('id', l.id);
		system.debug('********************** ' + newPage);
		return newPage.setRedirect(true);
 
	}
	
}

The problem appears to be related to the action attribute in the apex:page control.  If I remove that attribute, the tabs display fine, but then I am not able to display the visualforce page for a specific recordtype.  The visualforce page displays for every recordtype, which is not what I need to happen. 

 

Any help is appreciated.

Thanks.