Activity Forums Salesforce® Discussions Create save & New Functionality in salesforce? Reply To: Create save & New Functionality in salesforce?

  • Suraj

    Member
    April 6, 2017 at 4:40 am

    Hi Manpreet,

    You can use this code.

    public class Save2new {
    ApexPages.StandardController msc=null;
    public Save2new(ApexPages.StandardController sc){
    msc=sc;
    }
    public PageReference dosaveandnew(){
    Sobject ac=msc.getRecord();
    upsert ac;
    String s='/'+'apex/VFpageName)';
    PageReference nextlink=new PageReference(s);
    nextlink.setRedirect(true);
    return(nextlink);
    }
    }