Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Adding button on a Form in Ax 2012 using class

(0) ShareShare
ReportReport
Posted on by 20

Dear All,

I am actually trying to create a Button on a form any kind of button either "Edit" or "New" using class in Ax 2012 through X++ code.
I am new to this...
Kindly please help me in this regard.
Thanks in advance.

  • Morij Waqar Profile Picture
    20 on at
    RE: Adding button on a Form in Ax 2012 using class

    Thanks for the reply

    Let me check this first.

  • Verified answer
    Blue Wang Profile Picture
    on at
    RE: Adding button on a Form in Ax 2012 using class

    Hi Morij,

    Please check this if it's helpful: cloudblogs.microsoft.com/.../

    Dialog                  dlg             = new Dialog();
    DialogGroup             dlgGroup;
    FormBuildGroupControl   buttonGroup;
    FormBuildButtonControl  buttonControl;
    
    dlgGroup        = dlg.addGroup('ButtonGroup');
    buttonGroup     = dlg.formBuildDesign().control(dlgGroup.formBuildGroup().id());
    buttonControl   = buttonGroup.addControl(FormControlType::Button, 'A Button');
    
    buttonControl.registerOverrideMethod(methodStr(FormButtonControl, clicked), 
                                             methodStr(YourClass, yourClickedMethod), 
                                             this);

  • Morij Waqar Profile Picture
    20 on at
    RE: Adding button on a Form in Ax 2012 using class

    Thanks Martin for the reply

    Actually I just want to add a simple button on a form using "FormBuildButtonControl" in Ax 2012

  • Martin Dráb Profile Picture
    232,114 Most Valuable Professional on at
    RE: Adding button on a Form in Ax 2012 using class

    Can you tell us more about the requirement, to allow us to provide a suitable solution?

    Wouldn't it be much easier to add the button to the form at design time and control its visibility by security or code?

    By the way, let me change the category of this thread, because it's cleatly about development and not "Other".

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,302 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,114 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans