You need to sign in to do that
Don't have an account?
Srinivas223
could someone tell me what I am missing here. Error:Cyclical server-side forwards detected: /apex/OppRecordTypeSelection
For a particular record type on Opportunity, I want to redirect the new button to a visualforce and the rest of the recordtypes to standard page layouts.
Controller
VF Page
I appreciate your help.
Thank you!
Controller
public with sharing class Demo_EXT{ public PageReference pageRef; public Opportunity opp; public Demo_EXT(ApexPages.StandardController myController){ this.opp = (opportunity)myController.getRecord(); } public PageReference Redirect() { // pageRef = new PageReference(); If(opp.recordtypeId == '0120O000000L6Ve'){ system.debug('----'+ opp.recordtypeid); pageRef = new PageReference('/apex/OppRecordTypeSelection'); return pageRef; } else return null; } }
VF Page
<apex:page standardcontroller="Opportunity" extensions="Demo_EXT" action="{!redirect}"> <apex:messages /> <apex:form > <apex:pageblock mode="edit" title=" Edit"> <apex:pageblockbuttons > <apex:commandbutton value="Save" action="{!Save}"/> <apex:commandbutton value="Cancel" action="{!Cancel}"/> </apex:pageblockbuttons> <apex:pageblocksection title="Information" showheader="true" columns="2"> <apex:inputfield value="{!Opportunity.Name}"/> <apex:outputfield value="{!Opportunity.OwnerId}"/> <apex:inputfield value="{!Opportunity.closeDate}" required="false"/> <apex:inputfield value="{!Opportunity.stagename}" required="false"/> <apex:pageblocksectionitem /> </apex:pageblocksection </apex:pageblock> </apex:form> </apex:page>
I appreciate your help.
Thank you!
All Answers