You need to sign in to do that
Don't have an account?
BHASKAR GANGULY
Apex PageReference clarification
HI,
I am new to Apex Programing.
I am trying to create a simple program using Visualforce where i am inserting Account data.I want to nevigate to the newly created Account Record by click on Save Button.But its not working.
Can some bosy help me here.
My VisualForce code :
<apex:page controller="TDname" sidebar="false">
<apex:form >
<apex:outputLabel >Account Name :</apex:outputLabel>
<apex:inputText value="{!Accname}"/>
<apex:commandButton value="Save" action="{!AccSave}"/>
</apex:form>
</apex:page>
My Apex Class :
public class TDname {
public string Accname{Set;Get;}
public void AccSave()
{
Account a = new Account();
a.name = Accname;
Insert a;
}
Public PageReference save()
{
PageReference acctPage = new ApexPages.StandardController(account).view();
acctPage.setRedirect(true);
return acctPage;
}
}
I am new to Apex Programing.
I am trying to create a simple program using Visualforce where i am inserting Account data.I want to nevigate to the newly created Account Record by click on Save Button.But its not working.
Can some bosy help me here.
My VisualForce code :
<apex:page controller="TDname" sidebar="false">
<apex:form >
<apex:outputLabel >Account Name :</apex:outputLabel>
<apex:inputText value="{!Accname}"/>
<apex:commandButton value="Save" action="{!AccSave}"/>
</apex:form>
</apex:page>
My Apex Class :
public class TDname {
public string Accname{Set;Get;}
public void AccSave()
{
Account a = new Account();
a.name = Accname;
Insert a;
}
Public PageReference save()
{
PageReference acctPage = new ApexPages.StandardController(account).view();
acctPage.setRedirect(true);
return acctPage;
}
}
Best Answer chosen by BHASKAR GANGULY
BHASKAR GANGULY
I resolved the problem.