Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a button to a dialog and create a method for the click event

In Axapta, How to add a button to a dialog and intercept the click event? Thanks

like image 718
stighy Avatar asked Feb 20 '23 01:02

stighy


1 Answers

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.

like image 62
AnthonyBlake Avatar answered May 16 '23 09:05

AnthonyBlake