You need to sign in to do that
Don't have an account?
shephali
i want to insert data as well as fetch and sent dat data to another VF page on button click.both VF page sharing the same controller
i want to insert data as well as fetch and sent dat data to another VF page on button click.both VF pages are sharing the same controller
I am using following code for insertion but now on clicking save button i want to select one field that i have just inserted and send it to another VF page.
///apex class:
Public class MyExtension
{
Mobile_Agent__c agent;
public MyExtension(ApexPages.StandardController con)
{
agent=(Mobile_Agent__c)con.getRecord();
}
public PageReference save()
{
if(agent!=null)
insert agent;
PageReference pr=new PageReference('/apex/v5');
pr.setRedirect(true);
return pr;
}
}
////VF page
<apex:page sidebar="false" standardController="Mobile_Agent__c" extensions="MyExtension">
<apex:form >
<apex:pageBlock title="Register Agent mobile">
<apex:pageBlockSection >
<apex:inputfield value="{! Mobile_Agent__c.Name }" /> <br/>
<apex:inputfield value="{! Mobile_Agent__c.Last_Name__c }" /> <br/>
<apex:inputfield value="{! Mobile_Agent__c.Device_Phone__c}" /> <br/>
<apex:inputfield value="{! Mobile_Agent__c.Subscriber_ID__c}" />
</apex:pageBlockSection>
<p> <apex:commandButton action="{!save}" value="Register Agent mobile"/></p>
</apex:pageBlock>
</apex:form>
</apex:page>