Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

creating form through x++

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

hi,

i need to create form with one enum based on the selection change i need to do some  operation

how to do that..

i have tried using formcomboboxcontrol..but when i access the selectionchange using control object ..the ax running stopped 

..

how to resolve this..

thanks in advance

*This post is locked for comments

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: creating form through x++

    It's a bad idea to create form from code, instead build form in AOT with all required controls and methods and then invoice it where you need it.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: creating form through x++

    hi,

    this is my code ..where i need to done this (on changing the selection i need to get the record count)

    static void Job101(Args _args)

    {

       Form                    form;

       FormRun                 formRun;

       Args                    args;

       FormBuildDesign         formBuildDesign;

       FormBuildControl        formBuildControl;

       FormBuildTabControl     formBuildTabControl;

       FormBuildTabPageControl formBuildTabPageControl;

       FormBuildGridControl    formBuildGridControl;

       FormBuildDatasource     formBuildDatasource;

       FormBuildStringControl  formString;

       FormComboBoxControl     comboBox;

       form = new Form();

       formBuildDesign = form.addDesign('design');

       comboBox = formBuildDesign.addControl(FormControlType::ComboBox,'Enum');

       comboBox.enumType(enumNum(NKDept));

       args    = new Args();

       args.object(form);

       formRun = classFactory.formRunClass(args);

       formRun.init();

       formRun.run();

       formRun.wait();

    }

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: creating form through x++

    Dont use selectionchange use modifiedfield method.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans