Control text file

S0918423470
S0918423470 Member Posts: 159
Hello all,

I have a question :

I have a text data file after i import into nav by dataport, i want to delete it or delete the content of this file.

How can we do that??

Thanks,
HN

Answers

  • Albertvh
    Albertvh Member Posts: 516
    Hi,
    Try something like this

    in DataPort - OnPostDataport section

    ERASE(CurrDataport.FILENAME);


    Albert
  • S0918423470
    S0918423470 Member Posts: 159
    Hi,

    I try and it's work so well. Thank you so much.

    :lol:

    HN
  • jversusj
    jversusj Member Posts: 489
    Albertvh wrote:
    Hi,
    Try something like this

    in DataPort - OnPostDataport section

    ERASE(CurrDataport.FILENAME);


    Albert
    Hi Albert,
    I tried to use this, but I get an error that the file is already in use and cannot be deleted. I put the code OnPostDataport, and have confirmed that the system is attempting to delete the proper file. Any ideas? I gave any user in our network full control of my test file, so it shouldn't be a permission issue.
    kind of fell into this...
  • Albertvh
    Albertvh Member Posts: 516
    Hi jversusj,

    Sorry for the late reply but we had a holiday here. :D

    add a line before the ERASE

    CurrFile.CLOSE;



    Albert