Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. PageReference invoicePage = Page.AP_Mensaje__c;
  2. invoicePage.getParameters().put('mensaje', 'This a message');
  3. return invoicePage;
  4.  
  5. public AP_Prueba_Controller() {
  6.  
  7. }
  8.  
  9. public AP_Prueba_Controller(ApexPages.StandardController controller) {
  10. }
  11.  
  12.  
  13. public PageReference init() {
  14.  
  15. PageReference invoicePage = Page.AP_Mensaje;
  16. invoicePage.getParameters().put('mensaje', 'Esto es un mensaje');
  17. invoicePage.setRedirect(true);
  18.  
  19.  
  20. return invoicePage;
  21.  
  22. }
  23.  
  24. <apex:page standardcontroller="AP_Accion_Comercial__c" extensions="AP_Prueba_Controller" action="{!init}">
  25. <!-- Begin Default Content REMOVE THIS -->
  26. <h1>Congratulations</h1>
  27. This is your new Page
  28. <!-- End Default Content REMOVE THIS -->
  29.  
  30. public AP_Mensaje_Controller (ApexPages.StandardController controller) {
  31. }
  32.  
  33. public AP_Mensaje_Controller (ApexPages.StandardSetController controller) {
  34. }
  35.  
  36. public AP_Mensaje_Controller () {
  37. }
  38.  
  39. public void init() {
  40. String mensaje = System.currentPageReference().getParameters().get('mensaje');
  41. ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, mensaje ));
  42. }
  43.  
  44. <apex:page standardcontroller="Account" extensions="AP_Mensaje_Controller" action="{!init}" standardstylesheets="true">
  45. <apex:pagemessages ></apex:pagemessages>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement