Codeunit 1

Since discussion is currently going on about where the main menu comes from: How does Codeunit 1 do its job? Where is defined which of its functions is executed on what occasion? There are not only functions for start and end of login, but also for date calculations that get executed when a date expression is entered into a field etc. Where is all this defined and how can it be changed or extended? Regards, – Heinz Herbeck Waagner-Biro AG, Vienna, Austria

The shell calls the functions as it needs them, but you can extend the functions if you need it (e.g. security-group dependent selection of a main menu, YTD date calculation). I am assuming you have a legal developer’s license to do the job, so good luck. Alex

Yes, I can (and did) change some of the functions in Codeunit 1. But what I want to know is: How does the system know that the function to be called upon logout is named “LoginEnd” or, in the German version, “LoginEnde”? Is this hardcoded into Navision, or is there a configuration file somewhere that defines this mapping of “events” to function names? Regards,

It is hardcoded.

As I recall, the “events” are called by ID (or at least used to be), not by name. Just for fun, check this by renaming one of them.

And I recall upgrading a version 1.30 database to 2.60, where the 1.30 version had added some additonal functions to Codeunit 1. It was simply not possible to run the upgraded version without reassigning ID’s to the functions in the codeunit (and find all places where the function was used and rename it).[xx(]

quote:


Originally posted by pr
As I recall, the “events” are called by ID (or at least used to be), not by name.


Yes, after a search in my Navision installation directory for files containing the functions’ names failed, I suspected that there was some other magic involved [:p]

Hi, there is an older (approx. 2.01/2.50) word file available containing all the codeunit 1 triggers, which proofs that the system relies on specific numbers for specific tasks The most important representative starting in V2.01: trigger 4 for enabling multilanguage and trigger 5 to add a new menu function for the language to be selected interactively by the user. Torsten

quote:


Originally posted by Admin
It was simply not possible to run the upgraded version without reassigning ID’s to the functions in the codeunit (and find all places where the function was used and rename it).[xx(]