Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

DataField type in array

Posted on by 55

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

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: DataField type in array

    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.

  • Patryk Mi Profile Picture
    Patryk Mi 55 on at
    RE: DataField type in array

    I can't do it, i get an error:


    ssadasdasd.PNG

    But maybe i'm doing it wrong way. If so, please explain it. I'm kind of beginner in X++

  • Crispin John Augustine Profile Picture
    Crispin John Augustine 37,081 on at
    RE: DataField type in array

    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

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans