O'Reilly logo

Microsoft Dynamics NAV by Mark Brummel, Christopher Studebaker, David Studebaker, David Roys, Vjekoslav Babić, Cristina Nicolàs Lorente, Laura Nicolàs Lorente, Alex Chow

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

Writing the Code and Link methods

The next step is to write code and link the methods as a function to the table. Depending on the complexity of the code, we can leave it in one function, or use Natural Language Programming and Encapsulation to create multiple functions that explain our intention.

We will first focus on one function and explain how to structure the code.

Creating the cleaning entries

This function will be called automatically each day by the Job Queue, and has to create a Cleaning Entry for each room that is occupied or has not been cleaned for a week:

OnRun()
CreateCleaningEntryForEachRoom;

Since our function contains an iteration through a room record set, the Main function is a single description of the iteration.

In the following ...

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