You need to sign in to do that
Don't have an account?
Chitral Chadda
redirect vf page
<apex:page standardController="Contact" extensions ="custom_controller_name" >
<apex:form >
<apex:pageBlock title="Contact">
<apex:pageMessages />
<apex:pageBlockSection >
<apex:inputField value="{! contact.accountid}"/>
<apex:inputField value="{! contact.phone}"/>
<apex:inputField value="{! contact.FirstName}"/>
<apex:inputField value="{! contact.LastName}"/>
<apex:inputField value="{! contact.Fax}"/>
<apex:inputField value="{! contact.Email}"/>
<apex:inputField value="{! contact.title}"/>
<apex:inputField value="{! contact.phone}"/>
<apex:inputField value="{! contact.HomePhone}"/>
<apex:inputField value="{! contact.Department}"/>
<apex:inputField value="{! contact.Birthdate}"/>
<apex:inputField value="{! contact.MobilePhone}"/>
<apex:commandButton action="{! save }" value="save"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
when i save this it goes to the standard page
i want that when i save this it should open like
/apex/MyFormContact?id=00190000010HAtb (view mode) and not https://ap1.salesforce.com/00390000013dAX7
apex: class
public class custom_controller_name{
public Contact contact {get;set;}
public pagereference save(){
try{
insert contact;
}catch(Exception e){}
Pagereference pref = new pagereference('/apex/MyFormContact?id=' + contact.id);
pref.setredirect(true);
return pref;
}
}
it gives error :Error: Unknown constructor 'custom_controller_name.custom_controller_name(ApexPages.StandardController controller)'
<apex:form >
<apex:pageBlock title="Contact">
<apex:pageMessages />
<apex:pageBlockSection >
<apex:inputField value="{! contact.accountid}"/>
<apex:inputField value="{! contact.phone}"/>
<apex:inputField value="{! contact.FirstName}"/>
<apex:inputField value="{! contact.LastName}"/>
<apex:inputField value="{! contact.Fax}"/>
<apex:inputField value="{! contact.Email}"/>
<apex:inputField value="{! contact.title}"/>
<apex:inputField value="{! contact.phone}"/>
<apex:inputField value="{! contact.HomePhone}"/>
<apex:inputField value="{! contact.Department}"/>
<apex:inputField value="{! contact.Birthdate}"/>
<apex:inputField value="{! contact.MobilePhone}"/>
<apex:commandButton action="{! save }" value="save"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
when i save this it goes to the standard page
i want that when i save this it should open like
/apex/MyFormContact?id=00190000010HAtb (view mode) and not https://ap1.salesforce.com/00390000013dAX7
apex: class
public class custom_controller_name{
public Contact contact {get;set;}
public pagereference save(){
try{
insert contact;
}catch(Exception e){}
Pagereference pref = new pagereference('/apex/MyFormContact?id=' + contact.id);
pref.setredirect(true);
return pref;
}
}
it gives error :Error: Unknown constructor 'custom_controller_name.custom_controller_name(ApexPages.StandardController controller)'
If this answers your question, mark this as best answer.
Thanks,
N.J
All Answers
If this answers your question, mark this as best answer.
Thanks,
N.J
Wats is the use of dis statement