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
aparna d 1aparna d 1 

Dynamically display sections on a Visualforce page based on record type

I want to display case fields based on related opportunity recordtype. I am facing issues.Anyone please help on this.

<apex:page standardController="Case"   showHeader="false" applyBodyTag="false" applyHtmlTag="false">
<apex:form >
<apex:outputPanel rendered="{!IF(Case.Opportunity__r.RecordType.Name =’proposed Recordtype’,true,false)}"> -->
<apex:pageBlocksection >
<apex:outputLabel value="space" /> 
<apex:inputField value="{!Case.space__c}" />
</apex:pageBlocksection>
</apex:outputPanel >

<apex:outputPanel rendered="{!IF(Case.Opportunity__r.RecordType.Name =’Intial Recordtype’,true,false)}"> -->
<apex:pageBlocksection >
<apex:outputLabel value="counter" /> 
<apex:inputField value="{!Case.counter__c}" />
</apex:pageBlocksection>
</apex:outputPanel >
</apex:form> 
</apex:page>
Raquib SFRaquib SF
Hello Aparna,

Please put pageBlockSection under a pageBlock tag.

Link for reference : Salesforce example - Official (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_pageBlockSection.htm)

thanks!
aparna d 1aparna d 1
Hi Raquib,
Thanks for giving reply. I have added pageblock even its not working am getting sysntax error