The setup is the following: standard 6.01 demo installation, running both the Classic Client and RTC on the same machine (not optimal, I know).
Make the following changes to function BLOBExport in codeunit 419 "3-Tier Automation Mgt.":
MESSAGE('Before calling DOWNLOADFROMSTREAM\Path=[%1]\ToFile=[%2]',path,tofile); // Debug
DOWNLOADFROMSTREAM(NVInStream,Text006,Path,Text009,ToFile);
MESSAGE('After calling DOWNLOADFROMSTREAM\Path=[%1]\ToFile=[%2]',path,tofile); // Debug
I call the function using this bit of code:
ThreeTierAutomationMgt.BLOBExport(TempBlob,'c:\test.txt',FALSE));
The expected result is that the (text) file contained in TempBlob.Blob is exported as test.txt in c:\ of the RTC (which, incidentally is the same as c:\ of my Classic Client). However, running the code yields these results:
Before calling DOWNLOADFROMSTREAM
Path=[<TEMP>]
ToFile=[test.txt]
After calling DOWNLOADFROMSTREAM
Path=[<TEMP>]
ToFile=[C:\Documents and Settings\brocatis3101\Local Settings\Temp\Microsoft Dynamics NAV\3868\__TEMP__3bcc9a646f464b00be8c4eaca47f5bc5.txt]
So the ToFile parameter is modified by the DOWNLOADFROMSTREAM command. This is not documented anywhere (what a surprise :shock: ). Thing is, the parameter is only changed if the Path parameter is set to "MagicPath" (<TEMP>) which apparently is the secret way to avoid the "Save As" dialog (again, undocumented).
I want to save the file with the filename I supply, but without opening the "Save As" dialog. How do I do that?
Comments
Yes and no. The real problem is that it seems that the only way to bypass the user dialog is to specify "<TEMP>" as the path - and that in turn results in the file being saved in the folder specified by the TEMP environment variable.
It look decidedly dodgy :thumbsdown:
Senior NAV Developer
Elbek & Vejrup
For this reason, the RTC should decide where to download files when then dialog box is bypassed.
That fact that the method for bypassing the dialog box has been implemented in such a clumsy, undocumented and downright “un-NAV” way is just unfortunate.
Senior NAV Developer
Elbek & Vejrup
I have generated a text file on the service tier and need to move it to a network share without the user having to select the file path.
The customer wants specific people to be able to generate a electronic funds payment file but they don't want them to be able to access it after it has been generated. the actual passing of the file to the banking software is handled by someone else with enough permission to read the file.
Effectively the user that will crete the file has write only permission on the network share. However I cannot suppress the save path box. I have also tried setting the file to be generated directly to the desired path instead of on the service tier but that also fails.
Regards
Ian
Ian
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Did you check my blog?
http://mibuso.com/blogs/mohana/2011/02/20/file-export-in-rtc-with-%E2%80%9Ccommon-dialog-management%E2%80%9D/
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I hadn't but I have now .
I think it has solved the problem.
Many thanks
Ian
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
http://blogs.msdn.com/b/nav-reporting/archive/2009/10/08/send-email-with-pdf-attachment-in-nav-2009.aspx
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
DOWNLOADFROMSTREAM(NVInStream,Text006,Path,Text009,ToFile);
For a workaround can I set the 'Path' parameter to the 'ToFile' directory path. Will it resolve the issue? Or it may lead into other issues?
@rocatis : Did you figure out the way to resolve it? Please let me know. Thanks.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I have rewritten new function called BLOBImportWOCommDialog which will download my server file to client Temp folder (i.e. Magicpath (<TEMP>)) and then upload it .
I called above function from my code as below:
FileName := FileMgt.BLOBImportWOCommDialog(TempBlob,lFile);
IF FileName <> '' THEN
lLoggLine.FileData := TempBlob.Blob;
lLoggLine.MODIFY;
It worked successfully without popping out dialog window as I am uploading file from local <TEMP> folder.