run dataports both from code and from menu

AleSlammer
Member Posts: 25
Hi
I am making an upgrade tool for in Navision 5 where you are supposed to run severel dataports automatically from the code. It works just fine, when I set the UseReqForm property for the dataport objects to "No" and then run the code. My problem is that there is menuitems running these dataports. Obviously it is a problem that there is no requestform for the users.
I want to somehow skip the requestform from the code (I know the dataport.run where a parameter says whether to show requestform or not). The thing is that I also want to set other properties, which I can't from that function.
Or if I could somehow make a nice solution where I keep the UseregForm properties on the dataport objects set to No and then somehow is still able to run the dataports from the menu, without having to make a new codeunit for every dataport, that uses the DATAPORT.RUN and skip the request window. Please tell me there is a better way ](*,)
I am making an upgrade tool for in Navision 5 where you are supposed to run severel dataports automatically from the code. It works just fine, when I set the UseReqForm property for the dataport objects to "No" and then run the code. My problem is that there is menuitems running these dataports. Obviously it is a problem that there is no requestform for the users.
I want to somehow skip the requestform from the code (I know the dataport.run where a parameter says whether to show requestform or not). The thing is that I also want to set other properties, which I can't from that function.
Or if I could somehow make a nice solution where I keep the UseregForm properties on the dataport objects set to No and then somehow is still able to run the dataports from the menu, without having to make a new codeunit for every dataport, that uses the DATAPORT.RUN and skip the request window. Please tell me there is a better way ](*,)
0
Answers
-
Have you tried adding a function (or several) to the dataport that can set the parameters you want, then call those functions from the codeunit?Kyle Hardin - ArcherPoint0
-
Hi Kyle and thanks for answering. I have tried making a function and tried with
CurrDataport.USEREQFORM(FALSE);
andCurrDataport.USEREQUESTFORM(FALSE);
The dataport wasn't able to compile that. :-k0 -
DATAPORT.RUNMODAL(Number [, ReqWindow] [, Record])
0 -
Hi Mohana and thanks for answering. I have thought about that solution, but I can't set the direction or filename in that command, and I can't use that Command with a variable of my dataport as the first parameter - it requires an integer :-k
I wan't to first set the IMPORT(TRUE) and then specify the FILENAME before running the dataport without showing the request form0 -
I have made a similar tool not too long ago. I use a single instance codeunit to pass the parameters, setting them from the calling code and reading them from the dataport, so maybe that is worth having a look at.0
-
mBerger <-- thanks. It works great \:D/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