Tech Tip: Changes to Form Event command in v18
PRODUCT: 4D | VERSION: 18 | PLATFORM: Mac & Win
Published On: February 12, 2020
In v18, the Form event command is now the FORM Event command. Instead of returning a numeric value to identify the type of form event like it did in the past, FORM Event now returns an object containing information about the form event. For information about the object's properties, refer to the official documentation: https://doc.4d.com/4Dv18R2/4D/18-R2/FORM-Event.301-4802931.en.html
To obtain the numeric value for the form event, use Form event code or FORM Event.code. For example:
Case of : (FORM Event.code=On Load) ALERT("Hello World") End case |
Case of : (Form event code=On Load) ALERT("Hello World") End case |
Both of the above code samples will do the same thing: when the form is loaded, pop up an alert that says "Hello World".