Ways to clear all files in subdirectories

couberpu
Member Posts: 317
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
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
0
Answers
-
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\*.*0 -
Harry,
Yes, that is a good way.
Still want to find out if it is possible to put every thing into one report.
Thanks,
CouberPu0 -
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.0 -
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,
CouberPu0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions