Navision 2009 NAS & JOB Sheduler Issue

balhiniobalhinio Member Posts: 28
Hi All,

I have a simple code unit (50351) the code is the following:

IF NOT EXISTS('C:\TemplatesRelance\NAS.txt') THEN
MyFile.CREATE('C:\TemplatesRelance\NAS.txt');

MyFile.WRITEMODE(TRUE);
MyFile.TEXTMODE := TRUE ;
MyFile.OPEN('C:\TemplatesRelance\NAS.txt');
MyFile.WRITE('TEST NAS'+FORMAT(CURRENTDATETIME));

MyFile.CLOSE;

I create a JOB Sheduler that run my code unit (50351). when I run the JOB using the form of Job Sheduler Management the code unit is running successfully. I want to run my JOB using NAS Service, so I have installed correctly the NAS with the correct configuration.
in the Start-up Parameter I put 'JOBQUEUE' as value. I start the NAS Service, but nothing happening.

Thanks for help.

Comments

  • vijay_gvijay_g Member Posts: 884
    Did you check the Job Queue Log Entry? is there any error in this log? Also check event viewer for NAS Services has configured successfully or not.
  • balhiniobalhinio Member Posts: 28
    The Job Queue Log Entry is empty. No error in the event viewer except the notification of NAS started or NAS Stoped.
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV Three Tier' forum to 'NAV/Navision Classic Client' forum]


    Check http://www.mibuso.com/howtoinfo.asp?FileID=15 to see if your NAS is installed correctly.
    Some tests you can do: run command from dos WITHOUT the INSTALLASSERVICE-parameter. This way the NAS starts from DOS using the current Windows user (use RUNAS the change the user with which you run it.
    You can also add the DEBUG-parameter. This starts the debugger and you can debug the NAS.

    PS you have an error in your code if it doesn't exist, you CREATE the file and then OPEN it.: Probably you need something like this:
    MyFile.WRITEMODE(TRUE);
    MyFile.TEXTMODE := TRUE ;
    IF EXISTS('C:\TemplatesRelance\NAS.txt') THEN BEGIN
      MyFile.OPEN('C:\TemplatesRelance\NAS.txt');
    END
    ELSE BEGIN
      MyFile.CREATE('C:\TemplatesRelance\NAS.txt');
    END;
    
    MyFile.WRITE('TEST NAS'+FORMAT(CURRENTDATETIME));
    
    MyFile.CLOSE;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • KishraguKishragu Member Posts: 45
    What is the username under which NAS service is running? Also, is that user added to NAV database under "Windows Login" with relevant permissions?
  • balhiniobalhinio Member Posts: 28
    Hi all,

    I found that I must add a "JOB Queue Entry" as a parameter in the OnRun function of the code unit. The Job is running now correctly.
    But why I should add this parameter?

    Thanks for all of you
Sign In or Register to comment.