In Axapta, How to add a button to a dialog and intercept the click event? Thanks
Option 1;
This line is needed in dialog run()
element.controlMethodOverload(true);
The you can overload the click event;
public void MyButton_clicked()
{
//bla
}
Option 2;
Put your button action code in a separate class, and create a menu option, the add a menu item button to execute your code;
dialog.addMenuItemButton(MenuItemType::Action,"YourNewMenuItem");
Which you use depends upon what you are trying to achieve really.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With