All Files available automatically in Dataport File O

thetallblokethetallbloke Member Posts: 66
Hi all,

Is it possible to have the 'Files of type:' set to "All Files" automatically when the user selects a file on a dataport request form...???

As a proof of concept I wanted to incorporate a VB.Net DLL in Navision. so I created a DLL with a very simple method to accept an an Excel file name, convert it to CSV and save it in the same directory..

This allows my users who need to import data through a dataport to select an excel file, and run the dataport as if they'd selected a CSV file... they have no idea it gets converted and imported that way... I didn't really want them to go and convert files themselves or try to save them as CSV...

Every time they go to import a file however, they have to select "All Files" in the File Open dialog window... An easy step I know, but I'd like to make it easier for my users.

Thanks...
.
I'm not crazy !!! Just ask my toaster...
.

Answers

  • garakgarak Member Posts: 3,263
    it's possible, if you modify the requ. Option form.
    So, you must there insert your own Textbox and "OnAssistEdit()" Trigger you use the CommonDialog
    YourFilenameTxtVariable := CommDlgMgmt.OpenFile('DESCRIPTION','',4,'ALL (*.*)|*.*|CSV (*.csv)|*.csv|Text (*.txt)|*.txt',0);
    

    Then in trigger Dataport - OnPreDataport() you type following
    CurrDataport.FILENAME := YourFilenameTxtVariable;
    

    Regards
    Do you make it right, it works too!
  • kinekine Member Posts: 12,562
    You can add your own Edit Box for selecting the file and using the CommonDialog codeunit to select the file. You can define own filter there...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • thetallblokethetallbloke Member Posts: 66
    Brilliant... thanks for letting me know the Navision Way :D

    Problem solved.
    .
    I'm not crazy !!! Just ask my toaster...
    .
  • garakgarak Member Posts: 3,263
    Please.
    Do you make it right, it works too!
Sign In or Register to comment.