0

After update visualforce page (picklist field) it does not refresh standard page. How it save standard page?

This my controller:

public with sharing class Myorderextension {

    public list<my_order__c> orderslist {get;set;}

    public Myorderextension(ApexPages.StandardController controller) {
        orderslist=[select Id,Name,Quantity__c,Product__c,Customer__c,Status__c,Products__c  from my_order__c ];
    }

    public pagereference save() {
        pagereference  pgre1=new pagereference ('/apex/Myorderpage');
        return pgre1;
    }

    public pagereference Cancel() {
        pagereference  pgre=new pagereference ('/a00/o');
        return pgre;
    }
}
1
  • That is still not clear what are you trying to achieve. Could you expand your question and probably include VF page code?
    – kurunve
    Commented Jul 13, 2016 at 8:09

2 Answers 2

0

try with "setRedirect(true)"

pagereference pgre1=new pagereference ('/apex/Myorderpage'); pgre1.setRedirect(true); return pgre1;

1
  • Thanks D VEL...I tried that one but if you put "set Redirect(true)" it wont save in vf page and standard page but if you put "set Redirect(false )" its refresh in vf page but it wont refresh in standarded page Commented Jul 13, 2016 at 8:54
0
public with sharing class Myorderextension {

    public list<my_order__c> orderslist {get;set;}

    public Myorderextension(ApexPages.StandardController controller) {
        orderslist=[select Id,Name,Quantity__c,Product__c,Customer__c,Status__c,Products__c  from my_order__c ];
    }

    public pagereference save()
    {
        pagereference pgre1 = new pagereference ('/apex/Myorderpage');
        pgre1.setRedirect(false); 
        update orderslist;
        return pgre1;
    }

    public pagereference Cancel()
    {
        pagereference  pgre=new pagereference ('/a00/o');
        return pgre;
    }

}

Not the answer you're looking for? Browse other questions tagged .