我需要将表中的所有显示方法放入缓存中,而不是手动输入(有很多显示方法)我试图动态地进行操作,即浏览表的每个方法,然后检查它是否是一种显示方法,用于获取tablemethodstr()
并将其放在表单数据源上cacheAddMethod()
的缓存中。
但是我找不到使用属性过滤方法的方法,所以我想知道在AX 2009中使用纯X ++是否甚至可以这样做?
干杯
答案 0 :(得分:2)
我刚刚写了一份工作,可以帮助你得到你需要的东西。我不完全确定这个问题,但你应该能够运行这个:
static void Job46(Args _args)
{
DictTable dictTable;
int i;
MethodInfo methodInfo;
SysDictTable dt = new sysDictTable(tableNum(Address));
;
dictTable = new dictTable(TableNum(Address));
for (i=1; i<dt.objectMethodCnt(); i++)
{
methodInfo = dt.objectMethodObject(i);
if (methodInfo.displayType() == DisplayFunctionType::Get)
info(strfmt("Found Display: %1 - %2 - %3", methodInfo.displayType(), enum2str(methodInfo.returnType()), methodInfo.name()));
else
info(strfmt("Not Display: %1 - %2 - %3", methodInfo.displayType(), enum2str(methodInfo.returnType()), methodInfo.name()));
}
}
一行注意事项是“methodInfo.displayType()== DisplayFunctionType :: Get”
编辑:可能需要“&lt; =”而不是“&lt;”...没有测试。你会搞清楚的。