Dataport and default option tab

manifold
Member Posts: 7
Hello!
When creating a new and simple dataport, there will be an automatically created option tab. That tab includes fields eg. "File name" and "Direction (import/export)". I'm not 100% sure whether this is a feature of the basic Navision, but I assume so.
Anyway, by default the "Direction" -option is either Import or Export. Now I wanted that the user MUST make the decision every time he/she uses the dataport (to prevent the "oops-phenomenon"). The options are therefore:
a) Nothing is selected by default and the process stops in error if the user don't choose anything.
b) There is a third, "NULL-option" (or something like that) and the process stops in error if the user don't make a reasonable decision.
The problem is that I can't find where I could edit the option-tab. If I open the "Request Form" its empty. If I add something on it, the above mentioned fields disappear... Any ideas where these options are?
PS. We don't have license to edit CAL-code/codeunits. Just forms, reports, etc... I hope that editing CAL-code is not the only option :?
Regards,
Timo Tasala
When creating a new and simple dataport, there will be an automatically created option tab. That tab includes fields eg. "File name" and "Direction (import/export)". I'm not 100% sure whether this is a feature of the basic Navision, but I assume so.
Anyway, by default the "Direction" -option is either Import or Export. Now I wanted that the user MUST make the decision every time he/she uses the dataport (to prevent the "oops-phenomenon"). The options are therefore:
a) Nothing is selected by default and the process stops in error if the user don't choose anything.
b) There is a third, "NULL-option" (or something like that) and the process stops in error if the user don't make a reasonable decision.
The problem is that I can't find where I could edit the option-tab. If I open the "Request Form" its empty. If I add something on it, the above mentioned fields disappear... Any ideas where these options are?
PS. We don't have license to edit CAL-code/codeunits. Just forms, reports, etc... I hope that editing CAL-code is not the only option :?
Regards,
Timo Tasala
0
Comments
-
Hi Timo
The import/export and filename settings are standard Navision.
You can edit these values on the dataport property window.
- in the editor go to first blank line after dataitem and hit the property button.
But there is no way around it without coding to "enlarge" the option with an extra optionvalue - i.e. for import/export with a <blank>
A quick solution could be to make a copy of the dataport and use 1 for imports and 1 for exports.
Or else make a new variable in the dataport of type option with <blank>,import,export and then on the onpredataport-trigger set the import/export property or return an error if blank. I don't know if your license gives permission to that or not.
Kindly
Quila0 -
Way around is to create your own requestform where you will add your controls and through code you will set the parameters based on this. But you will need some C/AL code to do that...0
-
Ok, here's what you need to do:
1. Create FileName as text variable
2. Create ImportDirection as option variable
3. Go to the request form, add a text box. Change the ID property to 1
4. Add radio buttons with your options
5. On the Dataport OnPreDataport trigger, type inCurrDataport.FILENAME(FileName)
6. On the Dataport OnPreDataport trigger, type in your code something like this:CASE ImportDirection OF ImportDirection::Nothing : error(); ImportDirection::Import : CurrDataport.IMPORT(TRUE); ImportDirection::Export : CurrDataport.IMPORT(FALSE); END;
Look at the C/SIDE reference guide, it has the functions documented.[/code]Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Hello,
i have create a dataport like you describe. But when I choose (by default)
CurrDataport.Import(false);
an i Click the Assistbutton for the Filename the System opens the OpenDialog instead of the SaveDialog.
Any ideas how i can solve this problem?
Vwohde
PS: Sorry for my bad English0 -
-
Savatage wrote:®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
-
kine wrote:Way around is to create your own requestform where you will add your controls and through code you will set the parameters based on this. But you will need some C/AL code to do that...
An interesting aside for people who haven't worked with a license other than a full developer, the Dataport/Report Editor license granule does allow you to edit the code within the Report or Dataport object, just not create/edit any Codeunit objects.
Cheers!Kristopher Webb
Microsoft Dynamics NAV Developer0 -
Funny story about that.... One of our customers hired a SQL Server guru that was also a good VB developer. This guy wanted to start programming their NAV database right away and found out he only had access to report code. So a few months later, I went back onsite and found almost a hundred reports with code modifications that complement posting routines.0
-
*lol* Give a man a fish, he eats for that day. Teach a man to fish, he starts a fish factory?Kristopher Webb
Microsoft Dynamics NAV Developer0
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