我在Dynamics AX7表单开发中工作。我必须在按钮的'Clicked'方法中编写代码,但在'Clicked'方法中已经存在一些'Sys Layer'代码。我必须对它应用一些条件。但我不想做'over-layering',我必须使用Extensions,但是如果我在onClicked事件中编写代码,问题是,我的代码在sys层代码之前或之后运行,但我需要在该sys层代码上应用一些条件。
我的问题是,我们可以使用扩展事件处理程序实现此逻辑吗?我已经使用over-layering完成了它,但我需要使用扩展来完成它。那么扩展可以做到吗?
下面添加了代码。
void clicked()
{
super();
// My logic will be written here
if(result == true) //This is my code, based on above logic I applied this check
{
// start of sys layer code
remainSalesPhysical.realValue(0);
remainInventPhysical.realValue(0);
if (formCtrl)
{
formCtrl.cancelLine();
}
element.closeOk();
// end of sys layer code
} //this is my code
else //this is my code
{ //this is my code
error("Some error message"); //this is my code
} //this is my code
}
答案 0 :(得分:0)
是和否。如果它只是一个pip install -r requirements.txt
,则button
并没有真正做任何事情,因此您可以执行super()
事件处理程序。
如果它是pre
,menu item button
调用一个类,那么你会对super()
而不是按钮执行post
事件处理程序,这样您的逻辑会在class
电话后立即运行。
在课堂上,如果课程有多个入口点,您可以执行super()
然后formRun = _xppPrePostArgs.getThis()
或任意数量的操作。