+ Start a Discussion
anvesh@force.comanvesh@force.com 

How to render recordtype to visual force page ?

I have created 2 VF pages and i want to display those VF page according to the record type selection. But it was showing 2 VF pages one by one at a  time. Please any one suggest or modify the below.


<apex:page controller="OppRenderPageClass">
   <apex:outputPanel rendered="{!IF(Opportunity.RecordTypeId == '012400000009mCCAAY',true,false)}">
        test<apex:outputField value="{!Opportunity.RecordTypeId}"/>
        <apex:include pageName="OppVfPage" />
    </apex:outputPanel>
    
    <apex:outputPanel rendered="{!IF(Opportunity.RecordTypeId !='01240000000UWKDAA4',true,false)}">
        <apex:include pageName="LostReason" />
    </apex:outputPanel>
    
</apex:page>
Rajendra RathoreRajendra Rathore
Hi Avesh,

Use that code :

<apex:page controller="OppRenderPageClass">
   <apex:outputPanel rendered="{!IF(Opportunity.RecordTypeId == '012400000009mCCAAY',true,false)}">
        test<apex:outputField value="{!Opportunity.RecordTypeId}"/>
        <apex:include pageName="OppVfPage" />
    </apex:outputPanel>
    
    <apex:outputPanel rendered="{!IF(Opportunity.RecordTypeId =='01240000000UWKDAA4',true,false)}">
        <apex:include pageName="LostReason" />
    </apex:outputPanel>
    
</apex:page>

Thanks,
Rajendra