Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public class getpara_Controller {
  2.  
  3. private ApexPages.StandardController sc;
  4. public String para {get;set;}
  5.  
  6. public getpara_Controller(ApexPages.StandardController sc) {
  7. this.sc = sc;
  8. para = ApexPages.currentPage().getParameters().get('custompara');
  9. //This is where I try to set the field value, clearly the sc.save() is a separate save of a custom_object__c record from the vf page.
  10. custom_object__c obj = new custom_object__c(lookup__c = para);
  11. }
  12.  
  13.  
  14.  
  15. public PageReference insertRedirect() {
  16. //Right here, this is where I want to assign the field value before using the sc.save()
  17. sc.save();
  18. PageReference endpage = new PageReference('https://www.example.com');
  19. endpage.setRedirect(true);
  20. return endpage;
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement