KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using V2 Macros with Different Method Types
PRODUCT: 4D | VERSION: 21 R | PLATFORM: Mac & Win
Published On: November 18, 2026
You can now use V2 macros to perform actions when creating different types of methods in 4D, including Database Methods, Triggers, Form Methods, and Object Methods.

The on_create macro event allows you to automate tasks when creating new methods, making your development workflow more efficient.

Example

The following macro definition in Macros.xml allows you to execute the EMACS_DoTask method when a new method is created:

<macro
name="New Method"
method_event="on_create"
in_menu="false"
type_ahead="false"
version="2">
<text><method>EMACS_DoTask("NewMethod";"<method_path/>")</text></method>