Hi All,
I created a simple "browse" page with one field named "Filepath" using AssisEdit to open a browse dialog. I made an action that has the following script:
Do Import - OnAction()
IF Filepath<>'' THEN
BEGIN
GlobalImport.InitVars;
IF GlobalImport.ImportCSVFileNoLog(Filepath)<>0 THEN
MESSAGE('Error encountered importing file. Please check the log for details.')
ELSE
MESSAGE('File ' + Filepath + ' imported');
END;
Where GlobalImport is a codeunit I've made that has all the code to do the import procedure.
Now when I run the page from the Object Explorer, it opens up the page in RTC just fine. I browse for a file and then click on the "Do Import" action that I've just made.
Now I'm getting this funky error message:
The server "net.[url=tcp://localhost:7046/DynamicsNAV/Service]tcp://localhost:7046/DynamicsNAV/Service[/url]" is either unavailable or your connection has been lost. Do you want to attempt to reconnect?"
I'm new to development in RTC, so I may have just missed something. Can anyone give me any clue? :?
Thanks in advance!
0
Comments
I've seen this message a few times before. It occurs imho if something goes wrong with filehandling, might even be the message command itself.
Try to change your code until the error disappears, then go forward again.If you use NAV 2013 you easy can use the debugger, if you use NAV 2009 debugging becomes a bit harder (search in this forum).
Hope this may help a bit.
Thomas
I traded my sanity for a railgun
Error message means there was an error condition on the server. Check the Event Viewer on the NAV Server, in most cases there is a more detailed error logged there.
Most likely, there is something wrong in the GlobalImport Codeunit. Compare your code with Codeunit 419. Or even better: try to use Codeunit 419 instead of writing your own functions. Most of the standard filehandling between client and server can be done with this Codeunit.
Last tip: if you want to track the position in the code where the error occurs, then use the debugger (I assume you are using NAV 2013).
My blog