Options

Navision Timer doesn't work in combination with NAS

Gollum83Gollum83 Member Posts: 19
Hi everybody
I have a big problem:i have a working NAS, which executes correctly my
codeunits, but NAS doesn't his job when there is a Navision Timer in the
codeunit.
Example of my code:
(OnRun):
IF ISCLEAR(Timer) THEN
CREATE(Timer);
Timer.Interval(10000);
Timer.Enabled(TRUE);

Timer::Timer(MilliSeconds: Integer)
MESSAGE('Time is %1',TIME);

There is a correct startup Parameter in CU1 NASHandler, all correct installed, but this example doesn't work, there aren't messages in the eventlog every 10 seconds, there is nothing.

Could you please help me.

Comments

  • Options
    DenSterDenSter Member Posts: 8,304
    Is your codeunit a single instance codeunit? Object designer, codeunit, open it in design mode, open property page. The SingleInstance property has to be 'Yes'.

    Then you are doing MESSAGE in a NAS. This will not display the message the way you expect. It will instead write an entry into the event log. Click Start, control panel, administrative tools, event viewer. Click on the Application node and look for where the source column has your NAS name. You should find your messages there.
  • Options
    DenSterDenSter Member Posts: 8,304
    Additionally, the nettype should be TCP, without the S at the end. This property is not available in the mgt snap-in for certain versions of NASSQL, so you will have to use the command line parameters and re-install NAS.
  • Options
    Gollum83Gollum83 Member Posts: 19
    The Codeunit is SingleInstance.
    I also have changed from tcps to tcp by registry.
    Without the timer ,nas works, only in combination with timer nothing works.
  • Options
    danlindstromdanlindstrom Member Posts: 130
    Instead of Timer use CommercePortal Timer

    Timer; Automation; 'Navision Timer 1.0'.Timer
    CountDown; Automation; 'CP Timer'.cCountDown

    Check the Codeunit 6220 MailHandler
    Regards
    Dan Lindström
    NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
    MBSP Developer for Microsoft Dynamics NAV 2009
  • Options
    Gollum83Gollum83 Member Posts: 19
    Hi danlinstrom: thanks for your hint.
    i have found the CP Timer, I created it, but it doesn't work correctly.

    New Codeunit, Single Instance:
    OnRun():
    IF ISCLEAR(CPTimer) THEN
    CREATE(CPTimer);
    CPTimer.Start(10);

    Timer::TimerEvent()
    MESSAGE('Clock is %1',TIME);

    When i run the CU, there is only one message, no more.
    Is the Interval defined in milliseconds?
    Can you help me?
  • Options
    danlindstromdanlindstrom Member Posts: 130
    One line is missing:

    Your code
    Timer::TimerEvent()
    MESSAGE('Clock is %1',TIME);

    New code
    Timer::TimerEvent()
    intNextInterval := IntervalInSek * 1000;
    MESSAGE('Clock is %1',TIME);
    Regards
    Dan Lindström
    NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
    MBSP Developer for Microsoft Dynamics NAV 2009
  • Options
    Gollum83Gollum83 Member Posts: 19
    It works on a ClientPC, not on NAS:

    OnRun():
    IF ISCLEAR(CPTimer) THEN
    CREATE(CPTimer);
    IntervalInSek := 10;
    CPTimer.Start(IntervalInSek);

    CPTimer::CountDown(VAR intNextInterval : Integer)
    intNextInterval := IntervalInSek * 1000;
    MESSAGE('Clock is %1',TIME);

    On Client I get a message every 10 seconds, in the eventlog of NAS nothing. I can't understand, if I would have installed the nas incorrect,
    normal operations(without timer) also would'nt work, but the do.
  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Is the ntimer.dll correctly registerd at the server? Do you have the appropriate rights to use it?
  • Options
    Gollum83Gollum83 Member Posts: 19
    At first i was not sure, if it is. But then i registered the dll manually by
    command prompt: regsvr32 "patth...\NTimer.dll", because of this I can exclause this mistake.

    After that i run the Codeunit in debug modus first at the client and then with the server.
    Client:goes until " CPTimer.Start(IntervalInSek);", then repeats the CountDown-Trigger every 10 second, allright.
    Server: goes until "CPTimer.Start(IntervalInSek);" then leaves the CU.
    Why?
  • Options
    Gollum83Gollum83 Member Posts: 19
    Now I know what is wrong.
    On my server I have installed both NAS and Business Notification Server.
    I deinstalled Business Notification Server for a few minutes and the Timer works.
    Does anybody know why NAS ist not compatible with Business Notification Server ?
  • Options
    DenSterDenSter Member Posts: 8,304
    So you are running two instances of NAS. Do you have two of them in your license? You can run as many instances of NAS as you want, but they have to be in your license. The foundation license comes with one instance, and you have to purchase each additional one.
  • Options
    Gollum83Gollum83 Member Posts: 19
    I have only one NAS server and a licensefile is in the correct folder.
    Does the Business Notification Server also needs a license file?
  • Options
    DenSterDenSter Member Posts: 8,304
    One machine is not relevant. What is relevant is that if you have two instances of NAS running, you need two instances of NAS in your license.
Sign In or Register to comment.