IF CGNASStartedinLoop = FALSE THEN CASE Parameter OF 'OSYNCH','JOBQUEUE': BEGIN // ... CODEUNIT.RUN(CODEUNIT::"Job Queue Dispacher"); //starts navtimer1 END; 'MSFSYNC' : CODEUNIT.RUN(CODEUNIT::"Data Sync. Management"); //FLEX.n //starts navtimer2 END;The NAS is started with 2 options: JOBQUEUE and MSFSYNC. So, from the NAS the cu Job Queue Dispatcher is started and also cu Data Sync. Management. Both codeunits are single instance and work with a nav timer. the cu Data Sync. Management is running very often. 100 times per second or so. Some more code from the timer trigger in cu Data Sync. Management:
Timer.Enabled := FALSE; IF CODEUNIT.RUN(CODEUNIT::"Process Sync. Queue") THEN; Timer.Enabled := TRUE;So, now my problem.
Timer.Enabled := FALSE; COMMIT; IF CODEUNIT.RUN(CODEUNIT::"Process Sync. Queue") THEN; Timer.Enabled := TRUE;then the error disappears.
Comments
Evert-Jan
It's very weird that the error message disappears when COMMIT is the first statement. At that point in time there should be no transaction started and thus no data modification to be commited.
When you try to switch off the timer in the other codeunit then you will still have a little period of time where this error message could occur. If you couldn't find another way you should think of calling both functionalities by one timer.
I would expect when you have two single instance codeunits then NAV should create to instances of the timer "class". But maybe there is a problem with the non existing multithread functionality of NAV. Perhaps someone with a better technical background of how is NAV working in detail could explain what is happening in such a case...
Evert-Jan
Although I still think both triggers should be in a seperate transaction and shouldn't interact with each other.
Also a possible solution. But as you mentioned you have to buy another NAS license.