NAS + NavTimer

SolmyrSolmyr Member Posts: 51
Hi all.
I don't want to duplicate the themes, but I've read the forum and haven't found the solution to my problem.

I have single instance codeunit 50000 "Test NAS CU". He has the function:
Name: AddStep

Parameters:
Var	Name	DataType	Subtype 	Length
No	pText	Text		               30

Local Variables:
Name	           DataType	Subtype	           Length
TestNASData	    Record	Test NAS Data	
NextNo	         Integer		

IF TestNASData.FINDLAST THEN
  NextNo := TestNASData."No." + 1
ELSE
  NextNo := 1;

TestNASData.INIT;
TestNASData."No." := NextNo;
TestNASData.Step := pText;
TestNASData.INSERT;
COMMIT;

This function is used to store NAS succesfull steps in special record: 50000 "Test NAS Data", which has two fields:
Enabled	Field No.	Field Name	Data Type	Length	Description
Yes	      1	           No.	   Integer		
Yes	      2	           Step	   Text	 30	

The OnRun trigger of codeunit 50000:
CLEAR(NavTimer);
CREATE(NavTimer);
AddStep('Timer created');

NavTimer.Interval := 1000;
AddStep('Interval is set');

NavTimer.Enabled := TRUE;
AddStep('Timer enabled');

The NavTimer::Timer(Milliseconds : Integer) code:
AddStep('On timer');

If I run this codeunit directly from NAV, as a result I have the following recordset:

1 Timer created
2 Interval is set
3 Timer enabled
4 On timer
5 On timer
6 On timer

But, when I'm trying to to this via NAS, I have only 2 records:

1 Timer created
2 Interval is set

As I understood the NavTimer.Enabled := TRUE; leads to the error. In Windows Event Viewer I can see warning message:
The call to member Enabled failed. NTimer.Timer.1 returned the following message:
Timer not enabled
.
Business Notification server is not installed. And I have no possibility to install another timer, for example Commerce Portal Timer. NAV version: NAV5 SP1. I also tried to reinstall the NAV, and it didn't help.
Oleg Dovgalenko

Comments

  • SolmyrSolmyr Member Posts: 51
    I've just tried to re-register NTimer.dll. Nothing changes.
    Oleg Dovgalenko
  • SolmyrSolmyr Member Posts: 51
    The problem is solved. We just manually restarted the PC and the error dissapeared. But we did a lot of changes (reinstall NAV, rewrite code, etc.) so now I can't tell what was the reason (if there was the reason except simple rebooting). It's a kind of magic :)
    Oleg Dovgalenko
Sign In or Register to comment.