Hi :)
I have a task to make dialog with undefined number of fields. I mean that I'm going throw InventTable and searching for missing data, when it occurs I'm adding a field to my dialog and display it at the end with all fields at the same time.
My only idea is like that:
d = new Dialog(); field1 = d.addField(types::String, "some text"); field2 = d.addField(types::String, "some text"); field3 = d.addField(types::String, "some text"); d.run();
it's not effective because I need to make a lot of variables, but DialogFields not allows to be an array.
Is there any solution to make that somehow like array to avoid making hundreds of variables?
*This post is locked for comments
Dialogs are used for inputs from users, not for displaying data. Is your intention to allow users to fill in the missing values, or why did you choose a dialog?
If you always show fields from InventTable, what about creating a form with InventTable as a datasource, putting all fields there and simply hide in code those you don't want to show?
Anyway, back to your question - you can easily add dialog fields to a List object, for instance.
I can't do it, i get an error:
But maybe i'm doing it wrong way. If so, please explain it. I'm kind of beginner in X++
So you know the answer yourself.
You can create Array fields.. docs.microsoft.com/.../x-standards-arrays
If you Need help specific to a situation, comment below
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156