+ Start a Discussion
Ram ArzaRam Arza 

I have an object called Industry__c. It has 3 recordtypes Shipping, Sales and Marketing. I have created 3 VFPages. ShippingVFPage, SalesVFPage and MarketingVFPage.

Shipping VFPage:
<apex:page controller="Diffrectypes"> <apex:pageBlock title="VFPage1"> <apex:pageBlockSection title="VFPageSection1"> </apex:pageBlockSection> </apex:pageBlock>


MarketingVFPage
<apex:page controller="Diffrectypes"> <apex:pageBlock title="VFPage1"> <apex:pageBlockSection title="VFPageSection1"> </apex:pageBlockSection> </apex:pageBlock>


SalesVFPage
<apex:page controller="Diffrectypes"> <apex:pageBlock title="VFPage1"> <apex:pageBlockSection title="VFPageSection1"> </apex:pageBlockSection> </apex:pageBlock>


I want to create a controller with a method to call vfpage based on recordtype. when recordtype is selected and continue button is clicked . but I am not sure how to do it. how can I achieve it.
sandeep madhavsandeep madhav
Hi,
Get the selected record type to controller and have a condition to redirect to page.
Example:

Record type selected value will be in - Record_Type_Selected ='shipping'
if(Record_Type_Selected=='shipping'){
   PageReference p = new Pagereference('ShippingPage');
   p.setredirect(true);
}
else if(Record_Type_Selected=='Marketing'){
   PageReference p = new Pagereference('MarketingPage');
   p.setredirect(true);
}
else if(Record_Type_Selected=='sales'){
   PageReference p = new Pagereference('SalesPage');
   p.setredirect(true);
}

Hope this helps, Mark this as best answer if this helps.