Export to textfile in C/SIDE

WaldoWaldo Member Posts: 3,412
edited 2003-05-19 in Navision Attain
In http://www.mibuso.com/forum/viewtopic.php?t=748&highlight=export+objects it is explained how to export in code to a fob file.

Now, I would like to create a txt file (export an object to text through c/side-code) and no binary fob file. Does somebody know how to do this?

Eric Wauters
MVP - Microsoft Dynamics NAV
My blog

Comments

  • DenSterDenSter Member Posts: 8,307
    from the object designer, click File/Export. Select TXT as the file type and click OK. Make sure the file extension is .TXT and not .FOB. This exports a Navision object as text.

    HTH
  • WaldoWaldo Member Posts: 3,412
    Yes, that I already knew,

    but I would want to create such txt files in CODE. So, how can I write a codeunit to export objects to text-files?

    Thanks anyway for taking the time to reply

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • DenSterDenSter Member Posts: 8,307
    Oh I'm sorry about that, I guess I should have read the article that you linked to first then huh :shock:
  • SanyaSanya Member Posts: 11
    Hi,

    I realised it by this:

    OnPreDataItem:

    OutputFile.CREATE(lrc_ServiceEinr."Exportpfad " + gtx_Filename + '.txt');
    OutputFile.TEXTMODE(TRUE);

    The variable OutputFile is a "file" and the field "Exportpfad" is a new field in the table "Service Mgt. Setup". Into this field you can type in your path, where the file is to be saved.

    And into the OnAfterGetRecord Trigger:

    OutputFile.WRITE( your variables );

    I hope I understood your problem right. And I hope you understand my confusing description :lol:
Sign In or Register to comment.