You need to sign in to do that
Don't have an account?
page reference is not working
pagereference parentpage=new pagereference('/'+id);i tried like above and below
return new ApexPages.StandardController(oldtisdetails).view();
both are not working please help me..
Below is an example of both options which work fine.
<apex:page controller="mySecondController" tabStyle="Account">
<apex:sectionHeader title="New Account Edit Page" />
<apex:form>
<apex:pageBlock title="Create a New Account">
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Account Information">
<apex:inputField id="accountName" value="{!account.name}"/>
<apex:inputField id="accountSite" value="{!account.site}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
public class mySecondController {
Account account;
public Account getAccount() {
if(account == null) account = new Account();
return account;
}
public PageReference save() {
// Add the account to the database.
insert account;
// option 1
return new PageReference('/' + account.Id);
// option 2
//return new ApexPages.StandardController(account).view();
}
}
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_system_pagereference.htm
can you try these codes
Opcion 1
PageReference pr=new PageReference('/'+olddetailsId);
pr.setRedirect(true);
return pr;
Opcion 2
PageReference OldDetailsPage = new ApexPages.StandardController(oldtisdetails).view();
OldDetailsPage.setRedirect(true);
return OldDetails;
Please try this below sample code Here "a" is object handler.
Regards,
Jyothsna D