+ Start a Discussion
admin sureshadmin suresh 

I have a scenorio,, while creating a new contact page, if i select a RecordType1 it should redirect to visualforce page and if i select RecordType2 it should go to standard contact page?

Override New button to use vf page. in extension redirect user to standard screen or different vf page based on your requirement. 
admin sureshadmin suresh
NOT WORKING-- Please help me

<apex:page standardController="Contact" extensions="ContactRecordTypePage" action="{!redirectToPage}">
public class ContactRecordTypePage
   private final ApexPages.StandardController controller;
    public ContactRecordTypePage(apexpages.standardcontroller controller)
       this.controller = controller;
    public PageReference redirectToPage() {
        ID id = ApexPages.currentPage().getParameters().get('RecordTypeID');
       if (id == '01290000001AnHy')
           PageReference p = new PageReference('003/e?retURL=%2F003%2Fo&RecordType=01290000001AnHy&ent=Contact');
           return p;
             //return Page.RehireBadgeOnly.setRedirect(true);
        // return new PageReference('/003/e?retURL=%2F003%2Fo');
           PageReference p1 = new PageReference('003/e?retURL=%2F003%2Fo&RecordType=01290000001AnII&ent=Contact');
           return p1;
        //return null;
       return null;