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
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