KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Method events and macros
PRODUCT: 4D | VERSION: 16 | PLATFORM: Mac & Win
Published On: June 30, 2017

Method events, much like form events, exist to help automate tasks to perform some action. There are four method events available:

  1. on_load: Triggered when a method is opened.
  2. on_create: Triggered when a method is created.
  3. on_save: Triggered when a method is saved.
  4. on_close: Triggered when a method is closed.
To specify what happens if onoe of these events are triggred, a macro file should be used. Macros are simply an xml file that specify what should happen if a method event is triggered. Macro files should be saved as "Macros.xml" and placed in a folder next to the structure with the name "Macros". The following table is an example:



For more information on method events and macros, see documentation here.