You need to sign in to do that
Don't have an account?
Harsha Shri
render VF page based on record type selection
Hi All,
I have the followwing VF page and controller class
when I am selecting selecting record type, VF page is not redering
Please help me if any correction need to do for above code
Thanks in Advance
I have the followwing VF page and controller class
<apex:page standardController="test__c" extensions="Recordtypes" id="pg"> <apex:form > <apex:pageBlock title="Recordtypes" id="pd"> <apex:selectList size="1" value="{!RecordTypes}" > <apex:actionSupport event="onchange" reRender="panel1,panel2" /> RecordTypes : <apex:selectOptions value="{!RecordTypes}"> </apex:selectOptions> </apex:selectList> <apex:outputPanel id="panel1"> <apex:pageBlockSection rendered="{!RecordTypes=='R1'}" > Field1 : <apex:inputText /> </apex:pageBlockSection> </apex:outputPanel> <apex:outputPanel id="panel2"> <apex:pageBlockSection rendered="{!RecordTypes=='R2'}" > Field2 : <apex:inputText /> </apex:pageBlockSection> </apex:outputPanel> </apex:pageBlock> </apex:form> </apex:page>
public class Recordtypes { public list<selectoption> lstOfRectypes{set;get;} List<RecordType> recList; test__c t; ApexPages.StandardController controller; public Recordtypes (ApexPages.StandardController controller) { this.controller = controller; t = (test__c) Controller.getRecord(); } public list<SelectOption> getRecordTypes() { list<SelectOption> options = new list<SelectOption>(); for (list<RecordType> rts : [SELECT ID, name FROM RecordType WHERE SObjectType = 'test__c' ORDER BY name]) { for (RecordType rt : rts) { options.add(new SelectOption(rt.ID, rt.Name)); } } return options; } }I have written above code, to render VF page based on record type selection
when I am selecting selecting record type, VF page is not redering
Please help me if any correction need to do for above code
Thanks in Advance
Hi Harsha,
Please check code.
Hope this helps you.
If it helps you.Please mark it as the best answer.
Thanks
Varaprasad
All Answers
Hi Harsha,
Please check code.
Hope this helps you.
If it helps you.Please mark it as the best answer.
Thanks
Varaprasad
Hi Varaprasad
you are a awesome developer
Please give me your mail id, I want to stay in touch with you
If you dont mind give me your mobile number
Above information is informative and helps you please mark it as best answer.
Thanks
Varaprasad
@For support : Varaprasad4sfdc@gmail.com
Hi Harsha,
I marked it as best answer