You need to sign in to do that
Don't have an account?
jburns12
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
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.
This shows me Im getting a null value for selectedRecordType...WHY?
JB