You need to sign in to do that
Don't have an account?

Why my code does not save the page information?
I have custom page, and when i try to save it my page does not save any information. I used different type of codes for saving. Most of them does not work and some of them break my page. Is there anything wrong with my code that i could not find? ( My main problem is it should save information and return to the same page with values) Any idea? Thanks
public class test1 { public Product_Brief__c pb {get;set;} public User u {get;set;} private ApexPages.StandardController controller {get;set;} public boolean bUpdate {get;set;} public string loggedinUserId = UserInfo.getUserId(); public User u2 = [Select ContactId From User where Id =: '005R0000001Y6h4']; public String ctId{ get { ctId = u2.ContactId; return ctId; } set; } Contact ct = [SELECT AccountId FROM Contact WHERE id=:ctId]; public string getacct(){ Account acct = [SELECT Name FROM Account WHERE id=:ct.AccountId]; return acct.Name; return null; } Opportunity opp = [SELECT Id FROM Opportunity WHERE AccountId=:ct.AccountId LIMIT 1]; /* public PageReference save() { controller.save();{ pageReference pg = new pageReference('/apex/pitu3'); pg.setRedirect(true); pg .getParameters().put('id',controller.getId()); return pg; } return null; } */ /* public PageReference save() { controller.save(); return null; } */ /* public PageReference save() { if(controller.save() != null) { PageReference ref = Page.sumpage3; ref.setRedirect(true); return ref; } return null; } */ public PageReference save() { if(controller.save() != null) { PageReference congratsPage = Page.pitu3; congratsPage.setRedirect(true); congratsPage.getParameters().put('id',controller.getId()); return congratsPage; }return null; } public test1(ApexPages.StandardController controller) { this.controller = controller; } public PageReference page1(){ return Page.pitu1; } public PageReference page2(){ return Page.pitu2; } public PageReference page3(){ return Page.pitu3; } public PageReference page4(){ return Page.pitu4; } public PageReference page5(){ return Page.pitu5; } }
or something else.
Post your VF page if you still have issue and want to resolve it.
thx.