Navision 4.0 SP1 NAS Problem

Kc_NirvanaKc_Nirvana Member Posts: 146
Hello.....

I have a problem with the NAS Server.......
I have the NAS Server connected to the Job Scheduler.

My CU that runs with NAS
OnRun()
IF ISCLEAR(Timer) THEN
  CREATE(Timer);

JobSchedMgtSetup.GET();
IF JobSchedMgtSetup."Log Scheduler Actions" THEN
  UpdateStatus('',Text006,FALSE);
COMMIT;
Timer.Enabled := FALSE;
Timer.Interval := JobSchedMgtSetup."Interval Check (Sec.)" * 1000;
Timer.Enabled := TRUE;
IF JobSchedMgtSetup."Nas - In Execution" THEN
  CheckAndRunScheduler;

CheckAndRunScheduler()
JobSchedSetup2.RESET;

JobSchedSetup2.SETCURRENTKEY("Next Check Date","Next Check Time");
JobSchedSetup2.SETFILTER("Next Check Date",'<>%1',0D);
JobSchedSetup2.SETRANGE("Run Status",JobSchedSetup2."Run Status"::" ",JobSchedSetup2."Run Status"::"With Error");
JobSchedSetup2.SETRANGE(Enabled,TRUE);
JobSchedSetup2.SETRANGE(JobSchedSetup2."NAS Startup Parameter",NASStartupParameter);
IF JobSchedSetup2.FIND('-') THEN BEGIN
  REPEAT
    JobSchedSetup := JobSchedSetup2;
    IF RunNow(JobSchedSetup."Next Check Date",JobSchedSetup."Next Check Time") THEN BEGIN
      IF AllObj.GET(JobSchedSetup."Object Type",JobSchedSetup."Object No.") THEN BEGIN
        IF RunObjectFromJobSched.RUN(JobSchedSetup) THEN BEGIN
          JobSchedSetup.LOCKTABLE;
          NewDateAndTime(JobSchedSetup);
        END 
        ELSE 
        BEGIN
          JobSchedSetup.LOCKTABLE;
          JobSchedSetup."Message Text" := '';
          ErrorHandling(JobSchedSetup);
        END;
      END
      ELSE 
      BEGIN
         JobSchedSetup.LOCKTABLE;
         JobSchedSetup."Message Text" :=
         STRSUBSTNO(Text020,JobSchedSetup."Object Type",JobSchedSetup."Object No.");
         ErrorHandling(JobSchedSetup);
       END;
      JobSchedSetup.MODIFY;
      UpdateStatus(JobSchedSetup.ID,JobSchedSetup."Message Text",FALSE);
      JobSchedMgtSetup.GET;

      COMMIT;
    END;
  UNTIL JobSchedSetup2.NEXT = 0;
END;

But when it cames to run an object from the Job Scheduler doesn't run...... (RunObjectFromJobSched.RUN(JobSchedSetup) )
The object that runs in Job Scheduler is:
CREATE(WSVouchersWifi);
SalesRecSetup.GET;
SalesRecSetup.TESTFIELD("User Vouchers");
SalesRecSetup.TESTFIELD("Password Vouchers");
SalesRecSetup.TESTFIELD("ConnectionString NAV");

IF WSVouchersWifi.SetConfig(SalesRecSetup."User Vouchers",
                          SalesRecSetup."Password Vouchers",
                          SalesRecSetup."ConnectionString NAV") THEN BEGIN
  return := WSVouchersWifi.GetVouchers;
END;
and it's a codeunit single instance....
But if i go to the job scheduler and run the task, it runs perfectly
Can someone helps with this problem?
Junior Consultant & Developer in Dynamics NAV

"I'm worse at what I do best
And for this gift I feel blessed
Our little group has always been
And always will until the end"

Nirvana - Nevermind - Smells Like Teen Spirit

Comments

  • Kc_NirvanaKc_Nirvana Member Posts: 146
    Nobody knows what the problem?
    Junior Consultant & Developer in Dynamics NAV

    "I'm worse at what I do best
    And for this gift I feel blessed
    Our little group has always been
    And always will until the end"

    Nirvana - Nevermind - Smells Like Teen Spirit
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Take a look at the Job Queue Log Entries. If there is at least an entry for the last scheduled time you can be sure that everything is fine from the setup point of view. And there should be an error message in the corresponding column(s).
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Why do you want to run a single instance codeunit in the Job Queue?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Kc_NirvanaKc_Nirvana Member Posts: 146
    Take a look at the Job Queue Log Entries. If there is at least an entry for the last scheduled time you can be sure that everything is fine from the setup point of view. And there should be an error message in the corresponding column(s).
    There is an error....
    Its always the same:
    The job scheduler stopped due to an error. The program has moved the job to the next run date and time.
    Why do you want to run a single instance codeunit in the Job Queue?
    Because of NAS....
    But i tried without the single instance and the error maintains.......
    Junior Consultant & Developer in Dynamics NAV

    "I'm worse at what I do best
    And for this gift I feel blessed
    Our little group has always been
    And always will until the end"

    Nirvana - Nevermind - Smells Like Teen Spirit
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Just to be sure, only codeunits that use an external Automation Server have to be single instance, e.g. if you want to use NAV Timer component or NAV MSMQ component.

    On the quick I see two possibilities.
    1. Test your solution with a higher version of NAV. Because of the new system function GETLASTERRORTEXT you will be able to see in the Job Queue Log Entries what exactly is the problem.
    2. Try to start your NAS from command prompt with parameter "debug".
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.