How to join NAS and Timer?

arcull
Member Posts: 191
Hi guys. I am trying to schedule som data processing inside nav W1 4.0 SP2 and I thought to use NAS for this purpose. So I Installed the NAS that comes along with the nav installation and configured it in mmc as follows:
Database Server Name=<blank>, because I,ll use a local database
Database= <full path to the database>
Company Name= <The company I want to use inside db>
Start-Up Parameter=<SBA>
Net Type=<TCP/IP>
Object Cache Size (KB)=<8000>
Then I added a line of code in CU 1 which will run my test CU. The line loooks like this:
My CU SBAHandler looks like this:
The cu is sigle instance and if I run it manualy I get the message every 5 sec, with both timers 'Navision Timer 1.0'.Timer and 'CP Timer'.cCountDown it works ok. But when I close the database and theck the Event Viewer to see the messages, there is none. I get just warnings every 30 sec, saying that with the startup parameter <SBA> no service can be run. Looks like the timer event in my CU doesnt fire, because if I add the message in my CU in the OnRun trigger insted of in the CPTimer, I do get the message in the event log, but just every 30 sec, which I gues is the windows interval that runs the service, and that is not what I want. I have 10 application servers in licence. What could be wrong. Any suggestion welcome. Thanks.
Database Server Name=<blank>, because I,ll use a local database
Database= <full path to the database>
Company Name= <The company I want to use inside db>
Start-Up Parameter=<SBA>
Net Type=<TCP/IP>
Object Cache Size (KB)=<8000>
Then I added a line of code in CU 1 which will run my test CU. The line loooks like this:
SBAHandler.RUN; ParamStr := UPPERCASE(NASID); REPEAT...
My CU SBAHandler looks like this:
Documentation() OnRun() {IF ISCLEAR(NavisionTimer) THEN CREATE(NavisionTimer); NavisionTimer.Interval := 5000; NavisionTimer.Enabled := TRUE;} IF ISCLEAR(CPTimer) THEN CREATE(CPTimer); IntervalInSek := 5; CPTimer.Start(IntervalInSek); NavisionTimer::Timer(Milliseconds : Integer) MESSAGE('Time is %1',TIME); NavisionTimer::TimerError(ErrorString : Text[1024]) CPTimer::CountDown(VAR intNextInterval : Integer) intNextInterval := IntervalInSek * 1000; MESSAGE('Clock is %1',TIME);
The cu is sigle instance and if I run it manualy I get the message every 5 sec, with both timers 'Navision Timer 1.0'.Timer and 'CP Timer'.cCountDown it works ok. But when I close the database and theck the Event Viewer to see the messages, there is none. I get just warnings every 30 sec, saying that with the startup parameter <SBA> no service can be run. Looks like the timer event in my CU doesnt fire, because if I add the message in my CU in the OnRun trigger insted of in the CPTimer, I do get the message in the event log, but just every 30 sec, which I gues is the windows interval that runs the service, and that is not what I want. I have 10 application servers in licence. What could be wrong. Any suggestion welcome. Thanks.
0
Comments
-
That means that your NAS doesn't even start. If it starts correctly, there will be a message in the event viewer that says something like "NAV Application Server started successfully" and then lists the startup parameter. So at this point looking at your code is a complete waste of time, because NAS doesn't even get that far. First you will need to make sure that the NAS service has the right permissions, and set the right parameters.
Read the document called 'w1w1ATAS.pdf' in the doc folder on your product cd, and see if you can find the section that covers how to set up the NAS user, the one that runs the service.0 -
First you can debug your NAS to see whats wrong
viewtopic.php?t=23939
second
the error message "saying that with the startup parameter <SBA> no service can be run" means, that you has as Startupparameter "SBA" but in function NASHandler on CU1 there is no snippes of code where the SBA is used. And i hope that you use the local database without server only for tests. Because on a local database can only one connection established.
So when you do following in function NasHandler you have no problems.NASHandler() ... IF CGNASStartedinLoop = FALSE THEN CASE Parameter OF ..... 'SBA': //<--- this you must add in the case construct codeunit.run(50000); //or SBAHandler.run end; //cas end
Regards.Do you make it right, it works too!0 -
Hi,
Are you configuring your NAS to log into a Native Database, *fdb file, without going through a Navision Database server?
If so, the NAS will not be able to log into that database when you are logged in using a client.
If you don't logon using the Navision Database server or SQL then you can only have one connection to the database at a time.
Hope this helps,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
garak, KYDutchie thanks for your replies. I didn't know that I can debug NAS, in debug mode I have found out the source of my problem. Everything was setup ok, except a line of code in cu 1, that was missing
CGNASStartedinLoop := TRUE;
after runing my test CU, now it works like charm0
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
- 322 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