I knew about the <filename> controls needed to be designated as control n° 1 and it works but I can't manage to get the import/export radio changing dynamically the behaviour of dataport property, thus making impossible to use the filename dialog box for either an import or an export. Can you tell me if something is missing??
Sorry to ask but I can't read German...
Be blessed for your answer [-o<
Adding to what cmueller wrote earlier. To dynamically control import/export of a dataport, have a global variable (you could call it "Direction") declared as an option with the values "import" and "export". In the radiobuttons' properties you set their correct option value. Then, in your C/AL code, test to see which value has been selected by the end user and then set the import function accordingly.
IF Direction = Direction::Import THEN
CurrDataport.IMPORT(TRUE)
ELSE
CurrDataport.IMPORT(FALSE);
As cmueller already wrote, this code should be in your OnPreDataport-Trigger.
Comments
This is easily done using a text box and calls to the Common Dialog Management codeunit (412).
www.NextEqualZero.com
A technical eye on Dynamics NAV
http://www.navision24.de/tutorials/request-form-eines-dataports-selbst-gestalten.html
(Thanks Mark Teuber for the trick)
- create two new global variables ("Filename” / „Import” )
- open the request form
- insert a textbox (Property ID = 1 / AssistEdit = Yes / SourceExpr = Filename / Label for textbox ParentControl = 1
- insert a radiobutton Import (SourceExpr = Import / OptionValue = True
- insert a radiobutton Export (SourceExpr = Import / OptionValue = False
- insert on the OnPreDataport-Trigger this code
CurrDataport.IMPORT(Import);
CurrDataport.FILENAME(Filename);
Regards
Christian
I knew about the <filename> controls needed to be designated as control n° 1 and it works but I can't manage to get the import/export radio changing dynamically the behaviour of dataport property, thus making impossible to use the filename dialog box for either an import or an export. Can you tell me if something is missing??
Sorry to ask but I can't read German...
Be blessed for your answer [-o<
Best Regards
Denis
Adding to what cmueller wrote earlier. To dynamically control import/export of a dataport, have a global variable (you could call it "Direction") declared as an option with the values "import" and "export". In the radiobuttons' properties you set their correct option value. Then, in your C/AL code, test to see which value has been selected by the end user and then set the import function accordingly.
As cmueller already wrote, this code should be in your OnPreDataport-Trigger.
I hope this solves your problem.
Cheers!