Guest User

Untitled

a guest
Feb 24th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <apex:pageBlockButtons location="Top" >
  2. <apex:commandButton value="Save" action="{!saverec}"/> <br/><br/>
  3.  
  4. <apex:commandLink action="{!editOpp}" value="Edit"/>
  5.  
  6. Public Opportunity opp{get;set;}
  7. Public String op1;
  8. public id accid{set;get;}
  9.  
  10. Opp= (Opportunity)stdController.getRecord();
  11.  
  12.  
  13. }
  14.  
  15.  
  16. public PageReference saverec() {
  17.  
  18. insert opp;
  19.  
  20. pagereference pr = new pagereference('https://c.ap6.visual.force.com/apex/Opp2');
  21.  
  22. return pr;
  23. }
  24.  
  25.  
  26. public Pagereference editOpp()
  27.  
  28. PageReference ref = new PageReference('/'+selectedAccId+'/e?retURL=%2F'+selectedAccId);
  29. return ref;
  30.  
  31. }
  32.  
  33. <apex:commandLink action="{!deleteOpp}" value="Delete"/>
  34.  
  35. public List<Opportunity> Opp{get;set;}
  36. Public List<Opportunity> Opportunitylst{get;set;}
  37. public String selectedAccId {get;set;}
  38.  
  39. delete Opportunitylst;
  40. return null;
  41.  
  42. }
  43.  
  44.  
  45.  
  46.  
  47. public mycontroller1(){
  48. Opportunitylst=[select Name,AccountId,Amount,CloseDate,StageName from Opportunity order by createdDate DESC limit 10 ];
  49. }
  50. public Pagereference editOpp()
Add Comment
Please, Sign In to add comment