You can't using standard AX AFAIK.
AX calls WinAPI::getOpenFileName(...)
, which uses COMDLG32.dll
. You could copy/modify that method according to https://learn.microsoft.com/en-us/windows/win32/api/commdlg/, but good luck!
You can use .Net pretty easily though. I just threw this job together in a few minutes, so make sure to read up on the control. For example, there are properties like CheckFileExists
you might want. Error checking, etc. This should get you going though.
static void JobMultiselectDemo(Args _args)
{
System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
System.String[] results;
System.String sysFilename;
Filename axFilename;
int i;
int fileCount;
ofd.set_Multiselect(true);
ofd.set_Title("Multiselect demo");
ofd.set_DefaultExt("xml");
ofd.set_Filter("XML Files (*.txt)|*.xml");
ofd.ShowDialog();
results = ofd.get_FileNames();
fileCount = results.get_Count();
for (i=0; i<fileCount; i++)
{
sysFilename = results.get_Item(i);
axFilename = sysFilename;
info(axFilename);
}
}