AX视图View中添加静态方法

public static server str  EcoResCategoryName()
{
    DictView dv = new DictView(tableNum("ViewName"));

    SysDictTable ecoresCatory              = new SysDictTable(tableNum(EcoResCategory));//视图中包含数据源EcoResCategory

    str idFieldName = dv.computedColumnString(
        'EcoResProductCategory',
        fieldStr(EcoResProductCategory, Category),
        FieldNameGenerationMode::WhereClause);

    return strFmt('select Name from %1 where %1.recid = %2',
        ecoresCatory.name(DbBackend::Sql),
        idFieldName);
}

posted @ 2017-02-10 17:17  Alfred_CN  阅读(230)  评论(0编辑  收藏  举报