Notifications
Announcements
No record found.
Hi all,
I need to implement a dialog that provides, a user's, the possibility to choose more than one file, in order to run an unique import procedure.
How can I get what I want?
*This post is locked for comments
Hi Giuseppe,
How do you determine from the file which import to run?
Check out this link, it should be what you are looking for
http://dynamicsuser.net/forums/p/31783/171187.aspx
Try:
WinAPI::getOpenFileName(0, ['CSV', '*.CSV'], @'C:\', 'Select a file', '', '', 512);
512 flag allows you to select more than one file.
Hy,
I don't know if this will really work in all cases. The File names are #0 delimied each and the last hat two #0 entries. (historical c/c++string arrays). I'm not sure what the kernel will transfer from the bindata buffer to the string? But you can try. Maybe it works.
But why not use .NET class
see the following entry (sorry for the 'google')
groups.google.com/forum
regards
Douglas
Sorry M Z, but the result of the getOpenFileName() method is a string that contains the parent folder of files that I have selected. I need a list of the selected files...
I thought as much, therefore my apprehension. So give the .NET class a chance (the link is a full link, don't know why it is abbreviated)
think that can be the better way. But haven't tested.
Please give a short statement if the multislect using the .NET class can be used.
Hi Giuseppe, here is a job with code that I believe is what you are looking for.
static void AV_MultiFileSelectDlgTest(Args _args) { int idx; int cnt; boolean result; System.String[] files; Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.set_Multiselect(true); dlg.set_DefaultExt(".txt"); dlg.set_Filter("Text documents|*.txt|All files|*.*"); result = dlg.ShowDialog(); if (result) { files = dlg.get_FileNames(); cnt = files.get_Count(); for (idx = 0; idx <= cnt; idx++) { info(files.get_Item(idx)); } } }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2