O'Reilly logo

Programming Microsoft® Dynamics™ NAV: Create, modify, and maintain applications in NAV 5.0, the latest version of the ERP application formerly known as Navision by David Studebaker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Some Simple Coding Modifications

Now we're going to actually add some C/AL code to some objects we've created for our C/ANDL application.

Adding a Validation to a Table

Let's start with some code in the Validation triggers of our Table 50005 Volunteer Activity Ledger. When a new record is added to this table, we would like all the fields to be filled in. The description should be copied from the Volunteer Activity table. We can do that at the time the Volunteer Activity Code is validated. We also want to calculate the number of Volunteer Hours worked times the Points per Hour for the appropriate activity.

The basic logic is defined by the following pseudo-code:

In the Activity Code OnValidate trigger:

  • GET the Volunteer Activity record; allow for a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required