[solved]Custom Dataport Request Form

ta5
Member Posts: 1,164
Hello
We have a problem with a custom dataport request form, Navision 2.6 native.
This works ok
http://www.mibuso.com/howtoinfo.asp?FileID=4&Type=howto
When set the direction to export, a problem arises:
Browsing for export-file, we get the error "file xyz.txt does not exist", altough before currdataport.import was set to false. Imho the error message should not fire because the file does not exist has to be created by the dataport later. Importing a file works without a problem.
Any help would be appreciated.
Thomas
We have a problem with a custom dataport request form, Navision 2.6 native.
This works ok
http://www.mibuso.com/howtoinfo.asp?FileID=4&Type=howto
When set the direction to export, a problem arises:
Browsing for export-file, we get the error "file xyz.txt does not exist", altough before currdataport.import was set to false. Imho the error message should not fire because the file does not exist has to be created by the dataport later. Importing a file works without a problem.
Any help would be appreciated.
Thomas
0
Comments
-
Where did you set
CurrDataport.FILENAME := VarFilename;
?
You must set this onDataport - OnPreDataport()
Also if you use this Dataport to export, set the DataPort Property IMPORT to false
RegardsDo you make it right, it works too!0 -
[Topic moved from 'Navision Attain' forum to 'Navision Financials' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi
Yes, I set currdataport.filename on preDataPort. The Problem is the currdataport.import property. It does not work if it is set at run time. This means the file dialog does always show "open" or "save" according to the property set at design time...
Any other help would be appreciated.
Thanks
Thomas0 -
As i said:set the DataPort Property IMPORT to false
To set the porperty open dataport in Design mode -> go to a empty line of DataItem -> go to Property (Properties of the Dataport) -> Import (default is <yes>) -> NO -> Save the Dataport -> Test you dataport -> it works fine ;-)
RegardsDo you make it right, it works too!0 -
Hi
Sorry, I think my question was a bit confusing. Actually we could write in german
My problem is the following (sorry if you got it already):
I have a dataport with custom options, therefore the direction option and the file dialog are gone. I re-create them and all works ok, except the fact that the direction option does not work for the wizard.
This means that if I open the file dialog, it's always "open" or "save" as set in design time. Actually I think that if I set currdataport.import(false), then the dialog should be a "save" dialog and vice versa. The problem with this is, when I want to export and the file does not exist, an error is thrown: "file xyz.txt not found".
Thanks
Thomas0 -
german is better for me and for you, but not for the community ;-)
ok, if i underst. it correct, then you will use your Dataport (with custom made request form) for import AND export.Do you make it right, it works too!0 -
Sorry, for this case i know no way.
The only is: Set all your customized fields, for example, in a Report (or Form) and run from there the Dataport (call a Function in Dataport from Report / Form to set the values of variabels).
RegardsDo you make it right, it works too!0 -
Thats what I expected...
Thank anyway for your valuable 2nd opinion
Thomas0 -
amendment: You can also use the report for import / export the data (Variable of type File).
The file open Dialog is there also no problem.
RegardsDo you make it right, it works too!0 -
In your case it will be better to not use the COntrol ID = 1 trick and better will be to add code into OnAssistEdit of the control which will use the COmmon Dialog codeunit to pen correct dialog for you based on the Import/Export selection... ;-)0
-
](*,) the easiest solution and i see the wood not for the trees ](*,) :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops:
Here the source:
if you realy use Financials, you doesn't have the codeunit 412 Common Dialog Management. But in the Client Folder must be an ocx like mscomdlg.ocx (or so [Microsoft Common Dialog Control, version 6.0])TextBox - OnAssistEdit() OptionValue is a Varaible of Type Option (import,export) clear(CmDlgMgmt); OptionValue := 0; Fielname := CmDlgMgmt.OpenFile('Window Title',Fielname,1,'*.txt|*.*',OptionValue); CurrDataport.IMPORT(OptionValue = 0); Dataport - OnPreDataport() CurrDataport.FILENAME := Fielname;
RegardsDo you make it right, it works too!0 -
-
maybe Kamil, i need holiday :-(
Regards
RenéDo you make it right, it works too!0 -
garak wrote:if you realy use Financials, you doesn't have the codeunit 412 Common Dialog Management. But in the Client Folder must be an ocx like mscomdlg.ocx (or so [Microsoft Common Dialog Control, version 6.0])
Regards
Hi folks
Thanks for all input. We really use financial in this case. So the solution is to use cu412 from a 4.0 or so?
Thanks
Thomas0 -
You can, if your license have permissions for this ID...0
-
this is only possible if the customer license allow it to use this codeunit.
But in your client folder mus be a ocx called comdlg32.ocx.
This ocx you use as variable. Before register this DLL with Financials: Tools -> Custom Controls -> Control -> Browse (Extras -> Benutzerdefinierte Controls -> Control -> Suchen)
Now you can use thios ocx as Variable.
the source must look like:Name DataType Subtype Length CommonDialogControl OCX Microsoft Common Dialog Control, version 6.0 CommonDialogControl.FileName := DefaultFileName; CommonDialogControl.DialogTitle := WindowTitle; CommonDialogControl.Filter := YOUREXTENSIONFILTER; CommonDialogControl.InitDir := YOURINITDIR //C:\someFolder; if (OptionValue = 0) //import then CommonDialogControl.ShowOpen else CommonDialogControl.ShowSave; EXIT(CommonDialogControl.FileName);
RegardsDo you make it right, it works too!0 -
Also this might help : http://www.mibuso.com/forum/viewtopic.php?t=29858.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Great!
Thanks a lot, this forum is really very friendly and helpful!
Thomas0 -
this forum is really very friendly and helpful!
on this reason we are all members ;-)Do you make it right, it works too!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