I would like to run additional code when pressing the system button “Popout” on the right corner of a standard d365fo form(ex.SalesTable). What i need is to popou the window as the standard functionality did and then I want to show an info message. I would like to do this for multiple forms that’s why I want to do this more generic.
What I did until now:
I made an extention of the FormRun class and overide the onFormRun method
[ExtensionOf(classStr(FormRun))]
public final class FormRun_Test_Extension
{
[SubscribesTo(classStr(FormRun), staticDelegateStr(FormRun, onFormRun))]
public static void onFormRun (FormRun _formInstance)
{
GeneralEventHandlers::onFormRun(_formInstance);
}
}
public static void Test(FormControl sender, FormControlEventArgs e)
{
info(“Test”)
}
The problem is that the info message is not shown when I press the ‘Popout’ System button and the form appeared on the popout window. What am i missing? Am I on the correct dirrection? FYI: I already already read system-defined-buttons article.
I try to override/Extend the SystemDefinedPopoutButton for more that one standard d365fo forms. How I could achive to execute extra functionality when I press this system button? If you have any proposal for ‘earlier than in OnFormRun’ doing, please help me.
What I findout is that when I try to execute the form command button(Popout) and the command executed, the Test method will not be executed. If I run a similar command button without the command, the Test method will be executed.
popoutButton = buttonGroup.addControl(FormControlType::CommandButton, ‘SystemDefinedPopoutButton1’); //popoutButton.command(#taskPopout);
popoutButton.imageLocation(SysImageLocation::Symbol);
popoutButton.normalImage(“PopoutExpand”);
popoutButton.buttonDisplay(ButtonDisplay::ImageOnly);
popoutButton.OnClicked += eventhandler(TestEventHandlers::Test);
}}
Any idea how to overcome this problem?