DOWNLOAD txt in RTC
kirkostas
Member Posts: 127
I have a batch report to export a text file.
I was able to run it through RTC client because I use CDO 419.
New request need to stop prompt common dialog windows and read from a setup table the destination location of the exported file.
The code before was:
The problem is the file is not saved to the specific path. I don't have any error message at all. I remove the Magic Path the prompt ask me where to save and it work. I put on the magic path and the file does not work.
Filename is the full path of the file created on the RTC server.
Filename2 is the full path of the destination file I want to create.
Can anyone help?
I was able to run it through RTC client because I use CDO 419.
New request need to stop prompt common dialog windows and read from a setup table the destination location of the exported file.
The code before was:
DOWNLOAD(FileName, '', SetupTbl.Path, '', FileName2);and I thought I have to change the Setuptbl.Path only by entering the Magic Path so the new code is
DOWNLOAD(FileName, '', '<TEMP>', '', FileName2);
The problem is the file is not saved to the specific path. I don't have any error message at all. I remove the Magic Path the prompt ask me where to save and it work. I put on the magic path and the file does not work.
Filename is the full path of the file created on the RTC server.
Filename2 is the full path of the destination file I want to create.
Can anyone help?
kirkostas™
0
Comments
-
I have noticed sometimes in NAV, especially in parameters, you can't use literals directly you have to use a variable.
notice here in the NAV code from COD 419 it assigns the MagicPath first to a variable and then uses the variable as the parameterDownloadTempFile(ServerFileName : Text[1024]) : Text[1024] IF NOT ISSERVICETIER THEN EXIT(ServerFileName); FileName := ServerFileName; Path := Magicpath; DOWNLOAD(ServerFileName,'',Path,Text009,FileName); EXIT(FileName);
Magicpath() : Text[1024] EXIT('<TEMP>'); // MAGIC PATH makes sure we don't get a prompt
hope this helps
Steve0 -
Yes, I already did that with no success. I even used the Text009 of the CDO 419 just to be sure. It doesn't save the file, but if I remove the magic path it prompt me and I save the file. Why? Is it a bug of the magic path?kirkostas™0
-
-
Nice you working with Windows Script Host, but I have noticed you say in the exampleIf you want to export the file as in Classic Client like with common Dialogue Management, follow the below steps..
I use the internal function DOWNLOAD and I don't have any problem with prompt, the problem is the non prompt way. From the moment I used the magic path the file stop copy itself from server to client. If I use the prompt it worked. If you know there is a bug in DOWNLOAD function of Navision ok I will use wsHost but I will report this to Microsoft.kirkostas™0 -
I just realize when I call the internal system function DOWNLOAD with MagicPath the variable Filename2 change location. That's why it cannot be copied. So I must open an InStream variable and DOWNLOADFROMSTREAM from the MagicPath path and copy it by using 'Microsoft Scripting Runtime'.FileSystemObject Automation.
Thanks Mohana for the idea.kirkostas™0 -
kirkostas wrote:I just realize when I call the internal system function DOWNLOAD with MagicPath the variable Filename2 change location. That's why it cannot be copied. So I must open an InStream variable and DOWNLOADFROMSTREAM from the MagicPath path and copy it by using 'Microsoft Scripting Runtime'.FileSystemObject Automation.
Thanks Mohana for the idea.
welcome
0
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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 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
