You need to sign in to do that
Don't have an account?
Chitral Chadda
redirect vf page
<apex:page standardController="Contact" >
<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 wnat when i save this it should open like
/apex/MyFormContact?id=00190000010HAtb and not https://ap1.salesforce.com/00390000013dAX7
<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 wnat when i save this it should open like
/apex/MyFormContact?id=00190000010HAtb and not https://ap1.salesforce.com/00390000013dAX7
Add Extension in the VF page like:
then create a Apex Class and override the save method like:
let us know if you have any question .
please don't Forget to Mark this as your best answer if it works fine for you
Regards,
Grazitti Team
Web: www.grazitti.com
All Answers
You can write controller extension to overrride standard save method and redirect user to custom page.
This link might help you http://www.fishofprey.com/2012/03/using-standard-controller-save-method.html
Thanks,
N.J
Add Extension in the VF page like:
then create a Apex Class and override the save method like:
let us know if you have any question .
please don't Forget to Mark this as your best answer if it works fine for you
Regards,
Grazitti Team
Web: www.grazitti.com
i am getting this error
<apex:page standardController="Contact">
<apex:form >
<script>
function Redirect()
{
window.location="/apex/MyFormContact?id=00190000010HAtb";
}
</script>
<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}" onclick="{!Redirect}" value="save"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
This error is due to constructor. You didn't define a constructor in your controller. So please define constructor as follows in controller named custom_controller_name.
Regards,
Grazitti Team
Web: www.grazitti.com