Field triggers

To see field triggers, let us look at our Table 50000 Radio Show. Open the table in the Design mode. Highlight the No. field, press F9, and you will see the following:

Each field has two triggers, the OnValidate() trigger and the OnLookup() trigger, which function as follows:

  • OnValidate(): The C/AL code in this trigger is executed whenever an entry is made by the user. The intended use is to validate that the entry conforms to the design parameters for the field. It can also be executed under program control through the use of the VALIDATE function (which we will discuss later).
  • OnLookup(): Lookup behavior can be triggered ...

Get Programming Microsoft Dynamics NAV - Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.