Ways to clear all files in subdirectories

couberpucouberpu Member Posts: 317
edited 2014-04-28 in NAV Three Tier
Good Afternoon,

Need help on file handling.

I need to write a report which schedule to run every night:

1. The report will create items back ordered for the day by salesperson by customer.
2. The report will create a CSV file by salesperson
3. Salesperson will open the CSV file next day and work with customer on deciding if it is a back order or lost opportunity.

The file creation part is OK but I am not sure how to first clear all files form the day before in the subdirectory before generating new file for the day.

Is there a NAV file handling function to handle this?

Thanks,
CouberPu

Answers

  • SavatageSavatage Member Posts: 7,142
    edited 2014-04-28
    Couldn't you just create a batch job & schedule it to run once a day using Windows Scheduled Tasks.

    example.
    DEL /q c:\folder\*.*

    /q - is quiet mode and bypasses any manual confirmation

    We use it to clear previous days backups...
    Clearbackup.Bat Consists on 1 line
    DEL /q N:\Backup~1\DailyB~1\*.*
  • couberpucouberpu Member Posts: 317
    Harry,

    Yes, that is a good way.
    Still want to find out if it is possible to put every thing into one report.

    Thanks,
    CouberPu
  • SavatageSavatage Member Posts: 7,142
    You mean like running the batch file using SHELL from nav.

    Sounds like you want that to be the first thing the report does.

    Clear out the directory & then complete the report to create new files.
  • couberpucouberpu Member Posts: 317
    Harry,

    Yes. I can do that.

    Is there a NAV function to scan through subdirectory and using FILE.ERASE function to clear?
    My guesses is NO!

    Thanks,
    CouberPu
Sign In or Register to comment.