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
jburns12jburns12 

Visualforce Dispatch Page - Please help

Ok what am i missing here? I have this page to redirect to different visualforce pages based on record type. However it always redirects to the 'else"option. If someone could please take a look and let me know whats up?

 

Class:

 

 

public class VFDispatch {
public VFDispatch(ApexPages.StandardController sc) {
}

public PageReference redirectToPage() {
    String selectedRecordType = ApexPages.currentPage().getParameters().get('RecordType');
    if (selectedRecordType == 'FLDEBT')
        return Page.General_Contract.setRedirect(true);
    else
        return Page.GC2.setRedirect(true);
    }
}

 Page:

 

<apex:page standardController="PNC__c" extensions="VFDispatch" action="{!redirectToPage}">
</apex:page>

 

 

Thank you in advance,

 

Jason Burns

 

Cory CowgillCory Cowgill

Add a system debug line here:


String selectedRecordType = ApexPages.currentPage().getParameters().get('RecordType');
    system.debug('ReocrdType in Params == ' + selectedRecordType);
    if (selectedRecordType == 'FLDEBT')

 

Then open the System Log from the upper right menu. This will allow you to see the logs in your Salesforce Org. Then click on the link to exeucte your VF Page and look at the logs to see what value your passing around.

jburns12jburns12

This shows me Im getting a null value for selectedRecordType...WHY?

 

JB