Dynamics ax通过代码删除AOT节点
//通过UtilIdElements删除
static void Job1(Args _args) { UtilIdElements utilElement; ; ttsbegin; select utilElement where utilElement.name == 'myElementName' && utilElement.utilLevel == utilEntryLevel::cus // 用户层 && utilElement.recordType == utilElementType::Table; // 对象类型 if (utilelement) { utilElement.delete(); ttscommit; info('已删除.'); } else { ttsAbort; info('删除失败.'); } }
//通过TreeNode删除
static void Job1(Args _args) { TreeNode edt, edt2; ; edt = TreeNode::findNode("Data Dictionary\\Tables"); if (edt != null) { edt2 = edt.AOTfindChild("tablename"); if (edt2 != null) edt2.AOTdelete(); } }