Hi NAS Users
Trying to learn NAS and have set up a NAS Service okay. Setup a simple codeunit to excute a single field update on a table
but it gives an error in the Event Viewer - TableData 50003 does not exist.
My set up
CU1
IF CGNASStartedinLoop = FALSE THEN
CASE Parameter OF
'OSYNCH','JOBQUEUE':
BEGIN
IF NOT JobQueueSetup.GET THEN BEGIN
JobQueueSetup.INIT;
JobQueueSetup.INSERT;
END;
IF NOT JobQueueSetup."Job Queue Active" THEN BEGIN
JobQueueSetup.VALIDATE("Job Queue Active",TRUE);
JobQueueSetup.MODIFY;
END;
CODEUNIT.RUN(CODEUNIT::"Job Queue Dispacher");
END;
'NASTEST': CODEUNIT.RUN(CODEUNIT::"NAS Text");
END;
So I pass a NAS parameter call NASTEST and it runs the CU NAS Test - this bit is definitely working okay! =D> !
Created a Table 50003 NAS Text
10 NAS Test Integer (Primary Key)
20 No of Runs Integer
Created a Codunit 50001 NAS Test
NasTest.FINDFIRST;
NasTest."No of Runs" := NasTest."No of Runs" + 1;
NasTest.MODIFY;
If I run this table in normal Navision then No. of Runs field gets incremented no problem!
If I run this via NAS it doesn't know what the table 50003 is!
Thanks for your help in advance
!
Comments
You should put in something like that:
edit: I didn't see that "NAS Test" is your pk.
Thanks for your reply - appreciate it but still no difference - same error. I did put 1 record in there and it runs no problem from Navision itself 2009 R2!
Do you know where to find the latest NAS documentation - I've searched on Partnersource but failed to find it - a connecting link would be great!
With thanks
if this doesn't work, check that you're working on the same company/database on which nas is working...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Thanks for your reply.
Yes restarted the NAS many times and have tried adding Error (99) at the top of my codeunit 50001 and sure enough the EventViewer reports (99) - this is how I know that it is getting as far as my Codeunit 50001 okay!
With thanks
David
The answer seems to lie in changing the Table Property to DataPerCompany = FALSE but when I did this I got the same error again in
TableData 402 does not exist.
TableData 403 does not exist.
TableData 5079 does not exist.
Again changed the Table Properties to DataPerCompany = FALSE in each table and then it all worked okay...
The Application Server for Microsoft Dynamics NAV NASCronusDev started with the following configuration:
Database Server Name = XYZ
Database = Demo Database NAV (6-0) R2
Company = CRONUS (R2) UK Ltd.
Startup Parameter = NASTEST
The forums suggested changing the Table Properties to DataPerCompany = FALSE when the Company isn't declared but your pinched cmd...
@SET NASSVC=NASCronusDev
@SET SQLSERVER="XYZ"
@SET SQLDB="Demo Database NAV (6-0) R2"
@SET NASCOMPANY="CRONUS (R2) UK Ltd."
@SET NASSTARTUP="NASTEST"
@SET DEBUG=no
@SET NASPROG="C:\Program Files (x86)\Microsoft Dynamics NAV\60\Application Server\nassql.exe"
@IF "%1" == "yes" SET DEBUG=yes
%NASPROG% debug=%DEBUG%, appservername=%NASSVC%, NETTYPE=TCP, servername=%SQLSERVER%, database=%SQLDB%, company=%NASCOMPANY%, startupparameter=%NASSTARTUP%, objectcache=40000,installasservice
@REM Add ,installasservice
@REM ,installasservice
@REM net start %NASSVC%
net start %NASSVC%
@REM net stop %NASSVC%
But the company is declared as far as I can see!
Any idea why have to resort to using DataPerCompany = FALSE to get around it? The strange thing is I wasn't even calling tables 402, 403 & 5079!
With Thanks
There's a "copy" of all tables with DataPerCompany = TRUE (default) per Company on SQL Server. The tables are named Companyname$Tablename. If DataPerCompany is set to FALSE there's only one table on SQL Server of the same name. Maybe it has to do with it.
Just thought I update this NAS issue as I have finally got the answer!
When running a command file (see above) the line @SET NASCOMPANY="CRONUS (R2) UK Ltd." - after starting the NAS service and checking the NASMSnapIn.msc and highlighting the Company field - I noticed that my company name had an additional space at the end, i.e., "CRONUS (R2) UK Ltd. " - so instead of a Company does not exist error - you get the TableData does not exist - hence why the Table DataPerCompany property set to No works!
Until next time and thanks for all of your NAS help !