All,
Can anybody help me how to automate some activities on NAV 5?
Ex. We want to do invoice posting (batch job) every day on 6.00 pm (automatically). Is it possible? I've searched in this forum before and found something about NAS but I'm really new on this stuff. So, can anyone guide (or inspiring) me about using NAS and how it can solve my problem?
Regards,
Karel
0
Answers
Back to the NASHandler function. When your application server service starts, the first thing it does is call the NASHandler function and passes the start-up parameter text to it. You can see how the existing code parses the NASID parameter and then calls other codeunits based on the results. You will need to edit that code to look for your own NASID that you are going to pass and then call a codeunit (in which you will put the logic you wish to execute).
Any code that runs under a nas must not open any forms or dialog boxes. There is a function in C/AL named GUIALLOWED that you can call within code to determine if that code is being run under a nas process. The GUIALLOWED function will return a false result if called from a nas process. You will need to make sure any code you call makes proper use of GUIALLOWED to avoid any dialogs/forms, otherwise you will get an error in the task when it tries to open one of these.
ex. If any of this seems a bit confusing, I can understand and will be happy to answer further questions. Also, if you just want to schedule batch jobs, I wrote my own nas scheduler to run specified codeunits/processing reports at specified times and I would be happy to share the objects with you (of course you would need those object numbers in your license or you would need to renumber them to something that is within your license).
I traded my sanity for a railgun
Thanks very much for your explanation, it is very enlighten me!
I think this is what I looking for to solve my problem. So, steps are:
1. Install Navision Application Server
2. Specify a startup parameter for NAS
3. Modify Code Unit 1 on NAV 5
4. Apply NAS Scheduler (which is an object <is it a code unit?> in NAV that will be executed by NAS when it is started at first time). Is it correct? (Sorry if I've got it wrong.)
Question is: what is to edit in code unit 1? I've checked on it and it has procedure named NASHandler(NASID): Text(260). Also, I'm very glad if you really can share your object about NAS scheduler.
Thanks,
Karel
You can setup jobs that are linked to either reports or codeunits and you can have them run once or run at regular intervals with the Recurrence settings.
One very important thing about writing code that runs on NAS....make sure that there are no confirm, message, dialog or other user interface elements that are invoked in your code. This is because a NAS instance does not have a user interface and will throw an error if encounters code that requires a UI.
I've implemented this a few times now and it really works quite well.
Epimatic Corp.
http://www.epimatic.com
I will be happy to share my objects. You will need to make some custom changes for them to fit into your system, since they rely on other custom pieces I wrote for our own system, but it wouldn't be difficult compared to writing a scheduler from scratch
My scheduler design allows you to run as many Nas's as you like as schedulers, each with their own ID so that you can designate certain tasks to run on a specific nas scheduler, or you could simply run multiple schedulers if you wished to ensure that one was always available to run a task. Keep in mind, your license must include each nas server you wish to run.
I traded my sanity for a railgun
I traded my sanity for a railgun
Epimatic Corp.
http://www.epimatic.com
RIS Plus, LLC
MVP - Business Apps
Epimatic Corp.
http://www.epimatic.com
Say a few months from now you have an issue with the custom scheduler. You call your partner, they have their developer look at it, and before you know it, you spend 4-8 hours in consulting fees. Where I used to work that was $185 an hour, so you can see how fast that adds up. You purchase a granule, which might be a bit more right off the bat, but support (assuming that you are already paying for it) is already included at no additional charge.
RIS Plus, LLC
MVP - Business Apps
I traded my sanity for a railgun
At least, now I've get more hint about NAS and multiple choice to pick (which I don't have any before) about how to implement this on my case.
Regards,
Karel
RIS Plus, LLC
MVP - Business Apps