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
0
Comments
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
Quila
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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 in 6. On the Dataport OnPreDataport trigger, type in your code something like this:
Look at the C/SIDE reference guide, it has the functions documented.[/code]
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
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 English
http://www.BiloBeauty.com
http://www.autismspeaks.org
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
\:D/
http://www.BiloBeauty.com
http://www.autismspeaks.org
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!
Microsoft Dynamics NAV Developer
RIS Plus, LLC
Microsoft Dynamics NAV Developer