function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mysfdcmysfdc 

vf page save issue

i created 1 form in visualforce and 1 custom object in sf and kept it as standard controller in my page... and i wrote 1 custom controller and gave as extension in page............... now i want to save the values in that page as well as in my sf object how can we do that....... whenever m saving any data in that page its redirecting to sf object but i want to redirect it to same page with its values saved..... how to do that can anyone help me regarding this
abhisheksharmaabhisheksharma

Have you overridden save method, you can use PageReference for target page URL and redirect

sivaextsivaext

Hi

 

are you using standard save button or custom button save button?

 

if you use standard save button, it redirects sf object page

 

if you use custom save button , it calls extenstion controller and use page reference to redirect wherever you want.

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_pages_pagereference.htm

 

 

PremanathPremanath

hi follow this..

 

public class MyOwnLogic {
    Account AccRec;
    public MyOwnLogic(ApexPages.StandardController abc) {
        AccRec=(Account)abc.getRecord();
    }

}

 

 

prem

Shailesh DeshpandeShailesh Deshpande
It appears to me that you are using standard save I.e. action= {!save} and not implementing it in your extension. As a result it behaves like the standard save behaves.

you need to provide your own implementation for the save in order to redirect it to some other page.