1

我需要将表中的所有显示方法放入缓存中,因此我没有手动输入(有很多显示方法),而是尝试动态执行,即浏览表的每个方法,然后检查它是否是显示方法来获取tablemethodstr()并使用表单数据源将其放入缓存中cacheAddMethod()

但是我找不到使用它们的属性过滤方法的方法,所以我想知道是否可以在 AX 2009 中使用纯 X++ 这样做?

干杯

4

1 回答 1

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”

编辑:可能需要“<=”而不是“<”...没有测试。你会想办法的。

于 2012-06-04T19:21:48.477 回答