Specifying filename in a dataport WIHTOUT RequestForm

mel_sadek
Member Posts: 23
Hi,
I'm having a devil of a time trying to run a simple dataport that exports data from a Navision table to a specific file on the system. I am NOT using the RequestForm, because this dataport has to be an automated process that requires no user interaction.
I've searched all of the relevant topics on the forum, but I haven't found anything that works.
Here is the code that I use to "try" to make this a reality. I use a codeunit to first create the file and then run the dataport:
As you can see, the "transactions.csv" file is the name of the file I want to export to. I then run the dataport right after. Note that my RequestForm property is set to "No" already. When I run this codeunit, the file is created, but the dataport DOES NOT populate it. I've spent a good two hours on it, but no luck though. ](*,)
Thanks for your help in advance.
I'm having a devil of a time trying to run a simple dataport that exports data from a Navision table to a specific file on the system. I am NOT using the RequestForm, because this dataport has to be an automated process that requires no user interaction.
I've searched all of the relevant topics on the forum, but I haven't found anything that works.
Here is the code that I use to "try" to make this a reality. I use a codeunit to first create the file and then run the dataport:
MyFile.WRITEMODE(TRUE); MyFile.TEXTMODE(TRUE); MyFile.CREATE('C:\transactions.csv'); MyFile.CLOSE; MyDataport.IMPORT(FALSE) ; MyDataport.FILENAME:='C:\transactions.csv'; MyDataport.RUN;
As you can see, the "transactions.csv" file is the name of the file I want to export to. I then run the dataport right after. Note that my RequestForm property is set to "No" already. When I run this codeunit, the file is created, but the dataport DOES NOT populate it. I've spent a good two hours on it, but no luck though. ](*,)
Thanks for your help in advance.
0
Comments
-
have you tried testing the dataport , from the object designer, with th requestform set to true, i'm thinking it might just be exporting nothing**********************
** SI ** Bert Van Gestel **
**********************0 -
Thanks for your reply Bgestel.
No it wasn't the RequestForm property that was causing the problem. After a lot more digging I found that the Import property on the Dataport MUST be set to FALSE (either in design mode or AFTER completing the OnPreDataport trigger). I was setting it at the OnInitDataport trigger, which had no effect, hence my problem.
Now problem solved.
Thanks for your concern and appreciation.
Mods, consider this topic resolved.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