Class创建Form方法触发
1、覆盖dialogPostRun方法
public void dialogPostRun(DialogRunbase _dialog) { super(_dialog); _dialog.dialogForm().formRun().controlMethodOverload(true); _dialog.dialogForm().formRun().controlMethodOverloadObject(this); }
2、指定label ID此处使用函数定义
//classDeclaration方法: #DEFINE.dlgEditBomTypeFieldNo(1)//此处1为第四步中Fld<ID>_1的ID #DEFINE.dlgEditBomTypeCtrlName("Fld1_1")//可省略,主要作为备注名称
3、dialog创建使用上面第一行的函数,创建方式改为以下
//#dlgEditBomTypeFieldNo此处函数指定Field No即第二步中的1,可用数字替代,则省略第二步,第四步取此处即可 dlgEditBomType = new DialogField(dialog,enumStr(TEK_EditBomType),#dlgEditBomTypeFieldNo); dialog.addCtrlDialogField(dlgEditBomType.name()); dlgEditBomType.init(dialog); dlgEditBomType.label("Type"); dlgEditBomType.helpText("Type"); //正常方式为 //dlgActivity = dialog.addFieldValue(extendedTypeStr(TEK_Activity),activity,"Activity");
4、创建方法(modified) The format of the event method name is as follows: fld<ID>_1_<event name>
private void Fld1_1_modified() { Object control; control = dialog.formRun().controlCallingMethod(); if(control.modified()) { info("Modified triggered!"); } }
参考:
https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/106386/event-methods-override
https://community.dynamics.com/ax/b/axdaily/posts/handling-events-of-the-runbase-dialog-controls
留言评论
暂无留言