web
You’re offline. This is a read only version of the page.
close
Skip to main content
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.

I have the same question (0)
  • Martin Dráb Profile Picture
    236,499 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".

  • 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

  • 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 for the reply

    Let me check this first.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,933

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 793 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 537 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans