Upload on Service Layer without User Input

Troubles_In_Paradise
Member Posts: 588
Hi guys! I'm upgrading a codeunit from 4.0 to NAV 2009 R2 (This codeunit work with files).
Since we're running RTC we can see and work only with files located on the Service Layer.
So we could use the upload function. :-k Thus far I think ok!
But I crashed against 2 problems:
1. Files I have to upload are located in a directory on the client machine (I always know which is because it's specified in the Inventory Setup), but I don't know how many they are. I thought to do something like this:
2. My second problem is this codeunit must be run through Job Scheduler and with the upload function, in which user specify files with Dialog, JS, I think, will die...
(Edit: I could jump the code checking if I'm on 3 tier #-o )
My question is there a way to upload all files located in a (known) directory placed on the client machine without user input?
Since we're running RTC we can see and work only with files located on the Service Layer.
So we could use the upload function. :-k Thus far I think ok!
But I crashed against 2 problems:
1. Files I have to upload are located in a directory on the client machine (I always know which is because it's specified in the Inventory Setup), but I don't know how many they are. I thought to do something like this:
ok := false; repeat upload(...); ok := dialog.confirm('Finished?',false); until not(ok);but I find it not very nice for the end user, in particular if number of files is high.
2. My second problem is this codeunit must be run through Job Scheduler and with the upload function, in which user specify files with Dialog, JS, I think, will die...
(Edit: I could jump the code checking if I'm on 3 tier #-o )
My question is there a way to upload all files located in a (known) directory placed on the client machine without user input?
~Rik~
It works as expected... More or Less...
It works as expected... More or Less...
0
Comments
-
We are not far I think... , we haven't been able to find a solution yet... a colleague of mine suggested this code:
FileSystem Automation 'Windows Script Host Object Model'.FileSystemObject Folder Automation 'Windows Script Host Object Model'.Folder GroupFiles Automation 'Windows Script Host Object Model'.Files IF ISCLEAR(FileSystem) THEN CREATE(FileSystem,TRUE,TRUE); Folder := FileSystem.GetFolder('C:\Users\user\Desktop\folder'); GroupFiles := Folder.Files; MESSAGE(FORMAT(GroupFiles.Count));
With this code we obtain only the number of files in the folder... it would be great if I got the name of files...
Any ideas?~Rik~
It works as expected... More or Less...0 -
Tried also with this but in RTC it doesn't work... ](*,)
viewtopic.php?f=5&t=7855&view=unread#unread~Rik~
It works as expected... More or Less...0
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