web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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
    237,965 Most Valuable Professional on at

    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

    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

    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

    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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans