You need to sign in to do that
Don't have an account?
MattMet86
Here is the code from the extension controller for the scheduleReview button:
PageReference shows within existing VF page instead of redirecting to new page.
My pagereference is being shown within the existing VF page instead of redirecting to a new page. Can someone tell me what i have done wrong?
Here is the VF page before I click the button:
Here is the page after I click the button:
Here is the code for that group of buttons:
<apex:pageBlockButtons id="pbb_save" location="bottom" rendered="{!!sessionEditDisable}"> <apex:commandButton action="{!saveChangesNewPage}" value="Save Voluntary Info" rendered="{!!serviceSession}" rerender="theForm" status="status" /> <apex:commandButton action="{!ScheduleReview}" value="Save,Schedule Review" rendered="{!!serviceSession}" rerender="theForm" status="status" /> <apex:commandButton action="{!assignFollowUpTask}" value="Save,Assign Follow-Up Task" rendered="{!!serviceSession}" rerender="theForm" status="status" /> <apex:actionStatus id="status"> <apex:facet name="start"> <div style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.50; z-index: 1000; background-color: gray;"> </div> <div style="position: fixed; left: 0; top: 0; bottom: 0; right: 0; z-index: 1001; margin: 20% 50%"> <img src="/img/loading32.gif"/> </div > </apex:facet> </apex:actionStatus> </apex:pageBlockButtons>
Here is the code from the extension controller for the scheduleReview button:
public pageReference scheduleReview() { system.debug('in scheduleReview method'); saveChanges(); recordTypes = [SELECT id FROM RecordType WHERE (Name = 'ScheduleReview' OR Name = 'Schedule Review') AND sObjectType = 'Event' ]; Employee_Session__c es = [SELECT id,Employee__c,Session_Status__c FROM Employee_Session__c WHERE id = :esId]; PageReference pr; pr = new PageReference('/00U/e?'); pr.getParameters().put('what_id',es.Employee__c); pr.getParameters().put('retURL','%2F' + es.Employee__c); pr.getParameters().put('RecordType',recordTypes[0].id); pr.getParameters().put('ent','Event'); return pr; }
Add pr.setRedirect(true); in controller.
Let me if it helps you.
Please follow this code:
Add <apex:pageMessages/> at the top after the <apex:form tag so that we will know if there is any validation error.
Controller:
Also enable the debug and see if there is any error on the page.
Please do let me know if it helps you.
Regards,
Mahesh