Export (0) Print
Expand All
4 out of 5 rated this helpful - Rate this topic

DOWNLOAD Function (File)

Microsoft Dynamics Nav 2009

Sends a file from a Microsoft Dynamics NAV service to a RoleTailored client.


[Ok :=] DOWNLOAD(FromFile, DialogTitle, ToFolder, ToFilter, ToFile)

Parameters

FromFile

Type: text

The name of the file that you want to download to the client.

DialogTitle

Type: text

The title that you want to display on the dialog box.

ToFolder

Type: text

The name of the folder that is displayed in the dialog box. This is the default value, which can be changed.

ToFilter

Type: text

The type of file that is displayed in the dialog box. This is the default value, which can be changed.

ToFile

Type: variant

The file name that is shown in the dialog box. This is the default , which can be changed.

Type: Boolean

If you omit this optional return value, a run-time error occurs if the file cannot be found. If you include a return value, it is assumed that you will handle any errors.

true if the file was downloaded; otherwise, false.

In the new architecture, the business logic is run on the middle-tier server and not on the client.

This means that in Microsoft Dynamics NAV, files are created on the Microsoft Dynamics NAV service and not locally on the client computer as is the case in the Classic client. When you write code for the application, you must therefore remember where the files are created.

UPLOAD Function (File) and UPLOADINTOSTREAM Function (File) are used to send a file from a RoleTailored client to a Microsoft Dynamics NAV service.

DOWNLOAD Function (File) and DOWNLOADFROMSTREAM Function (File) are used to send a file from a Microsoft Dynamics NAV service to a RoleTailored client.

We recommend that you use the functions in Codeunit 419, 3-Tier Automation Mgt., to upload and download files.

This example shows how to use the DOWNLOAD function. It requires that you create the following variable.

Variable Data type

ToFile

Text

ToFile := 'ToFile.txt';
DOWNLOAD(‘FromFile.txt’,‘Download file’,’C:\’,’Text file(*.txt)|*.txt’,ToFile)
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.