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;
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....
Comments
"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
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.
Because of NAS....
But i tried without the single instance and the error maintains.......
"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
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".