daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [ExtensionOf(formStr(CustInvoiceJournal))]
  2. final class GoCustInvoiceJourForm_Extension
  3. {
  4.     public const int            listCreateRoot = 1;
  5.  
  6.     public void init()
  7.     {
  8.         next init();
  9.  
  10.         FormGridControl invoiceIDControl = this.control(this.controlid("CustInvoiceJour_InvoiceNum_Grid"));
  11.  
  12.         if(invoiceIDControl)
  13.         {
  14.             this.controlMethodOverload(true);
  15.             this.controlMethodOverloadObject(this);  
  16.  
  17.             invoiceIDControl.registerOverrideMethod(methodstr(FormGridControl, selectedMenuOption),
  18.                 formMethodStr(CustInvoiceJournal, selectedMenuOptionNew));
  19.             invoiceIDControl.registerOverrideMethod(methodStr(FormGridControl, getContextMenuOptions),
  20.                 formMethodStr(CustInvoiceJournal, getContextMenuOptionsNew));
  21.         }
  22.     }
  23.  
  24.     public str getContextMenuOptionsNew(FormStringControl _control)
  25.     {
  26.         ContextMenu     menu        = new ContextMenu();
  27.         List            menuOptions = new List(Types::Class);
  28.  
  29.         info("I'm in");
  30.        
  31.         ContextMenuOption contextMenu_changeID = ContextMenuOption::Create('testas', listCreateRoot);
  32.         menuOptions.addEnd(contextMenu_changeID);
  33.  
  34.         menu.ContextMenuOptions(menuOptions);
  35.  
  36.         _control.getContextMenuOptions();
  37.        
  38.         return menu.Serialize();
  39.     }
  40.  
  41.     /// <summary>
  42.     /// Define new override on the control for processing the user selection
  43.     /// </summary>
  44.     public void selectedMenuOptionNew(int selectedOption, FormStringControl _control)
  45.     {
  46.         switch (selectedOption)
  47.         {
  48.             case -1:
  49.                 break;
  50.             case listCreateRoot:
  51.                 info('testas');
  52.                 break;
  53.             default:
  54.                 break;
  55.         }
  56.     }
  57. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top