Could not find part of the path
JlT
Member Posts: 18
Hello!
I have written this code (in the OnAction trigger for a page action) to call a xml-port and import some data to a table. After selecting the file in the dialog box I get an error message saying "Could not find a part of the path 'C:\....". I have tried locating the file on the client computer and on the server but with no difference in result.
ImpFile.OPEN(FileMgt.OpenFileDialog('NAV File Browser','*.xml',''));
ImpFile.CREATEINSTREAM(Stream);
AvtImport.SETSOURCE(Stream);
AvtImport.IMPORT;
ImpFile.CLOSE;
Any suggestions in how to get it to work?
I have written this code (in the OnAction trigger for a page action) to call a xml-port and import some data to a table. After selecting the file in the dialog box I get an error message saying "Could not find a part of the path 'C:\....". I have tried locating the file on the client computer and on the server but with no difference in result.
ImpFile.OPEN(FileMgt.OpenFileDialog('NAV File Browser','*.xml',''));
ImpFile.CREATEINSTREAM(Stream);
AvtImport.SETSOURCE(Stream);
AvtImport.IMPORT;
ImpFile.CLOSE;
Any suggestions in how to get it to work?
0
Answers
-
Before using the FileMgt... in the OPEN-statement, check if the return-value of FileMgt is what you expect. Then try also the OPEN with the string it like you expect it and see what happens.
Remember also that "C:\...\..." is on the server where the NAV server is and not on the machine where the client is.
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
@JIT were you able to resolve this error? If yes, please share the solution. I am getting the same error and my code is same as yours.0
-
@BlackTiger Thanks for the feedback. I am working with a stand-alone installation. Server and client are on the same machine. The path is server-side.0
-
Make sure the account that is used to run the service (NST) has access to the path/file.0
-
I too faced this, there's couple of reasons behind this
1. Permission should be there.
2. The path do exist
3. If Client and server are not same. If its not same then you should make sure to copy the file to your current machine so that it can access to it. Actually this was my case. I was using One Click.
Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/1 -
@Kishorm @RockWithNAV Thanks for your replies.
My case is also the 3rd one which I just discovered. How did you copy file from client to server? Which standard functions did you use?0 -
There is a file management codeunit - I think it's CU 419, have a look in there (I don't have access to NAV right now). You'll find a function called UploadFileSilent that you need to use.1
-
You might find this blog by the NAV team useful...
https://blogs.msdn.microsoft.com/nav/2013/08/09/nav-pattern-of-the-week-silent-file-upload-and-download/1 -
Thanks @Kishorm for mentioning this post. I also ran into it while searching for help on google. But another function helped me which is the UPLOAD function.0
-
Yes, that blog talks about the UPLOAD (& DOWNLOAD functions)0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 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

