Creates a temporary file. This enables you to save data of any format to a temporary file. This file has a unique name and will be stored in a temporary file folder.
- Type: File Use this variable to refer to the file.
- Value: MsDos, UTF8, UTF16, or Windows Optionally, you can specify the encoding on the file. By specifying the text encoding, you ensure that all the language-specific characters are represented correctly in Microsoft Dynamics NAV when you read data and write data. For more information, see Text Encoding.
This example creates a temporary file that has the text Hello and then deletes the file by using the File.CLOSE function. This example requires that you create the following variable.
FileName.CREATETEMPFILE; FileName.WRITE('Hello'); FileName.CLOSE;