Hi Folks -
I have the below code in a Codeunit
Variable declaration
FileName Text
Instr Instream
Downloaded Boolean
Reportoutput BLOB
FileName := 'C:\temp\Salesquote.PDF';
ReportOutput.CREATEINSTREAM(Instr);
Downloaded := DOWNLOADFROMSTREAM(Instr,",'','',FileName);
My question is in the DOWNLOADFROMSTREAM function I have assigned it to Downloaded a Boolean variable for the return value and when I run my codeunit it prompts me the file Salesquote.PDF and prompts me to Save, Open or Cancel.
Is there any way I can save the content of the Reportoutput Blob field content directly to C:\temp\salesquote.pdf without getting a prompt for my input.
Any help is highly appreciated.
Thanks
RJ.
0
Answers
I would use Codeunit419 File Management's BLOBExport function to perform this.
You need to pass a special parameter to DOWNLOADFROMSTREAM function to make it stop showing the dialog and asking the user for an action.
Look into the codeunit 419, search for Magicpath, and see how it is used.
But indeed it would be probably easier for you to use a function from C419, like BLOBExportToServerFile, to do the job for you.
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/