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
Jeremy EudyJeremy Eudy 

Conditionally render visualforce page on record based on checkbox value

I have a custom object named Instruments. There is a visualforce page embed on the page layout of each record. I would like to conditionally render the visualforce page if the custom field, "High Priority" checkbox, on the record is false. Appreciate your help. Thanks.
VahidVahid
Hi Jeremy,

Practically it is not possible, but there may be tricks:

1. You can create a Visualforce page and put all the code in the single page using component and rendered based on the Checkbox value.
2. You can create a Visualforce page and use standardcontroller="Instrument__c" and you may use iFrame to display your page on the single page and based on Checkbox Value you can render the correct page. 

Thanks  
Abdul Vahid
iBirds Software Services Pvt. Ltd.
contact@ibirdsservices.com
Waqar Hussain SFWaqar Hussain SF
You can render vf page conditionaly using Rendere attribute. You can rendere pageBlock, outputPanel etc based on checkbox field.

See example
<apex:page StandardController="Opportunity">
    <apex:form>
        <apex:PageBlock id="pb1" rendered="{Opportunity.Custom_Field__c == true, true, false}">
			<h1> Render this block if Custom Checkbox field Custom_Field__c is Checked</h1>
		</apex:PageBlock>
		
		<apex:PageBlock id="pb2" rendered="{Opportunity.Custom_Field__c == false, true, false}">
			<h1> Render this block if Custom Checkbox field Custom_Field__c is Unchecked</h1>
		</apex:PageBlock>


    </apex:form>
</apex:page>