Calling another codeunit in the RTC, getting strange error
rjsf
Member Posts: 17
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!
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
-
Admin, I'm sorry I realized I probably should have posted in the other forum. If so please feel free to move my topic there.0
-
Hi
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.
Thomas0 -
I have not yet had a chance to do much with role tailored (so take this with a grain of salt). Given that most everything on role tailored occurs on server side, I seem to recall that there is a little extra effort involved if you want to act upon files on the client machine. If you are already doing this, or I'm wrong, feel free to ignore me
. I'm sure somewhat more familiar with role tailored can address this better. Thad Ryker
I traded my sanity for a railgun
0 -
[Topic moved from 'NAV/Navision Classic Client' to 'NAV Three Tier' forum]0
-
A few tips:
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).A good programmer makes al the right mistakes
My blog0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
