• Find out field list(EDT) on a AX Table


    static void Jimmy_TableListDictoryData(args a)
    {
        Dictionary      Dictionary      = new Dictionary();
        int             tableCounter    = Dictionary.tableNext(0);
        Dialog          Dialog          = new Dialog("Please Enter table");
        DialogField     dlgTableName    = Dialog.addField(typeId(TableName));//SysLastValue
        int             FieldCounter,i,m,TableId;
        DictTable       DictTable;
        DictField       DictField;
        str             extend;
        container       con;
        TableName       TableName;
        
    void fieldList(TableId      _TableId)
    {
    ;
        DictTable = new DictTable(_TableId);
    
        if(DictTable.id() == DictTable.id())//SysLastValue //InventTable
        {
            FieldCounter = DictTable.fieldNext(0);
            while(FieldCounter > 0)
            {
                DictField = new DictField(DictTable.id(),FieldCounter);
                if(!DictField.isSystem())
                {
                    switch(DictField.baseType())
                    {
                        case Types::Enum :
                            extend = enumid2name(DictField.enumId());break;
                        default :
                            extend = global::extendedTypeId2name(DictField.typeId());break;
                    }
                    con += ["id : " + int2str(DictField.id()),"name : " + DictField.name(),"label : " + DictField.label(),"Extend : " + extend];
                }
                FieldCounter = DictTable.fieldNext(FieldCounter);
            }
            setprefix(DictTable.name());
            for(i = 1; i <= conlen(Con); i ++)
            {
                m++;
                info(strfmt("The %1th field - %2,%3,%4,%5",m,conpeek(con,i),conpeek(con,i+1),conpeek(con,i+2),conpeek(con,i+3)));
                i += 3;
            }
        }
    }
    ;
        Dialog.doInit();
        dlgTableName.value("SysLastValue");
        if(!Dialog.run())
            return;
        TableName       = dlgTableName.value();
        TableId         = tablename2id(TableName);
        DictTable       = Dictionary.tableObject(TableId);
        if(!DictTable)
            return;
    
        while(tableCounter > 0)
        {
            if(TableId)
            {
                fieldList(TableId);
                return;
            }
            else
                fieldList(tableCounter);
            tableCounter = Dictionary.tableNext(tableCounter);
        }
    }
    
    
  • 相关阅读:
    NotMapped属性特性
    html.EditorForModel自定义模版
    ASP.NET MVC Core的TagHelper (高级特性)
    C#静态构造函数调用机制
    ASP.NET Forms 身份认证
    特别需要注意!
    观后感
    python进阶日记(生成器)
    python进阶日记(try except)
    python进阶日记(lambda函数)
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1891283.html
Copyright © 2020-2023  润新知