Running NAS with a scheduler

charlp
Member Posts: 21
Hi all,
I've spent the last two days reading most of the posts with regards to NAS but can't find the answer I'm looking for.
I'm running NAV 3.6 server with application server installed. Everything works fine, and I have even managed to create new services and run them with diffirent parameters.
My problem is that I have specific tasks which I want to run at scheduled times, but I don't want to use a timer to do this. Our license doesn't have the Job Scheduler granules, so that's not an option. I would basically like to start NAS from the command line, and once it finishes with it's task, I would like it to stop executing. Is this possible?
I tried writing a console app in .NET, and passing character code 27 (ESC) to the NAS console window (when started from the command line), in response to the "Press ESC to shut down Navision Attain Application Server NAV-CLASSIC." message, but this doesn't work either.
I can start and stop the service without any problems, but then I've got no idea if the execution of the task completed.
Thanks,
Charl
I've spent the last two days reading most of the posts with regards to NAS but can't find the answer I'm looking for.
I'm running NAV 3.6 server with application server installed. Everything works fine, and I have even managed to create new services and run them with diffirent parameters.
My problem is that I have specific tasks which I want to run at scheduled times, but I don't want to use a timer to do this. Our license doesn't have the Job Scheduler granules, so that's not an option. I would basically like to start NAS from the command line, and once it finishes with it's task, I would like it to stop executing. Is this possible?
I tried writing a console app in .NET, and passing character code 27 (ESC) to the NAS console window (when started from the command line), in response to the "Press ESC to shut down Navision Attain Application Server NAV-CLASSIC." message, but this doesn't work either.
I can start and stop the service without any problems, but then I've got no idea if the execution of the task completed.
Thanks,
Charl
0
Comments
-
Try this:
In codeunit 1 trigger 99, run another codeunit (NOT singleinstance) to do the work. When this is finished, put this at the end of the codeunit:COMMIT; ERROR('');
This will commit all changes and then generate an error. This should make the NAS crash and exit. And who cares if he crashed, because his job is done.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
You can do this at the end of the task the NAS executes:
SHELL(TXTCOMANDO, TXTPARAMETRO);
Where TXTCOMANDO = "c:\windows\system32\Command.com" and TXTPARAMETRO = "/c Net stop NASNAME"
-- Alejandro --0 -
Thanks guys!
kriki - unfortunately NAS terminates prematurely if the ERROR command is in CodeUnit 1 Trigger 99
amunozsu - your method works like a charm.....but leaves the console window open, which has to be killed with the task manager. But this is easy to fix.
Cheers!
Charl0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions