Choose File in ax Dialog

Below is the job to choose the selected file through the Dialog box.

static void DialogFilePath(Args _args)
{
    Dialog          dialog;
    Filename        filename;
    DialogField     dialogFilename;
    //To filter the files while selecting
    container      conFilter = ["Microsoft Excel 97-2003 Worksheet (.xls)" ,"*.xlsx"];
    //container    conFilter = ["Comma Seperated Value .txt ", "*.csv"];
     ;

    dialog = new dialog();
    dialog.caption("select a file");
    dialogFilename = dialog.addField(extendedTypeStr(FilenameOpen));
    //To filter the files while selecting    
    dialog.filenameLookupFilter(conFilter);
    dialog.run();

    if(dialog.closedOk())
        {
            filename = dialogFileName.value();
            box::info(filename);
        }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s