write file txt

How can I write a file. txt from Axapta?

Hi, You can create your own class with methods to get this done. To get you started, have a look at the class IntrastatDisk or at the smmMailingFileCreate. Or you can create a Job. Something like this for example: static void writeFile() { AsciiIo diskFile; Filename diskFileName; Str line; Container c; c = [1, “MyText”, 2, “HisText”]; diskFileName = “test”; diskFile = new AsciiIo(diskFileName,‘W’); diskFile.outRecordDelimiter(’\r\n’); diskFile.outFieldDelimiter(";"); diskFile.writeExp(c); } Of course you can add several validations to it. For example: Checking whether the file already exist WinAPI::fileExist2(diskFileName). Try it out, and study the examples. regards, Danny Gaethofs

Thanks Danny

Hi!

if I have a field that I want to have more than one record

I use while select to loop it and it works fine but these records shall have a different delimiter.

how do I do that?