• Through the name of EDT or Enum data type obtain to be used for table object inherit from Dictionary


    Using x++ code Through to the name of extend or Enum data type obtain to be used for table object inherit from AX Data Dictionary.

    you can enter the name of  extend or enum data type,and then obtain to table or map or view from data Dictionary!

     

    Wrote by Jimmy on Nov. 29th 2010

    Code as below:

     

    static void Jimmy_EDTEnumNameInheritDictionary(Args _args)
    {
    /**
    Enter the name of  extend or enum data type,
    and then obtain to table or map or view from data Dictionary!
    */
        Dictionary          _dictionary     = new Dictionary();
        Dialog              _Dialog         = new Dialog("Please Enter extendedType");
        DialogField         _dlgEDT         = _Dialog.addField(typeId(ExtendedDataTypeName),'ExtendedType');//EnumDataTypeName 40
        UtilIdElements      _UtilIdElements;
        DictTable           _CurDictTable;
        str 100             _CurEDT,extend,DirctTypeDes;
        DictField           _CurDictField;
        int                 i,j,mm;
    ;
        if(!_Dialog.run())
            return ;
            
        _CurEDT = _dlgEDT.value();
        setprefix(_CurEDT);
        for (i = 1; i <= _dictionary.tableCnt(); i++)
        {
            _CurDictTable = new DictTable(_dictionary.tableCnt2Id(i));
            IF(_CurDictTable.name() like "tmp*")
                continue;
            if (!_CurDictTable.isTmp()         &&
                !_CurDictTable.isSystemTable() &&
                !_CurDictTable.isMap()         &&
                !_CurDictTable.isView()
              )
            {
                 for(j = 1;j <= _CurDictTable.fieldCnt();j ++)
                 {
                    _CurDictField = new DictField(_CurDictTable.id(),_CurDictTable.fieldCnt2Id(j));
                    if(_CurDictField.isSystem())
                        continue;
                    switch(_CurDictField.baseType())
                    {
                        case types::Enum :
                            extend = global::enumId2Name(_CurDictField.enumId());break;
                        default :
                            extend = global::extendedTypeId2name(_CurDictField.typeId());break;
                    }
                    if(_CurDictTable.isMap())
                        DirctTypeDes = "Map";
                    if(_CurDictTable.isSql())
                        DirctTypeDes = "Sql table name ";
                    if(_CurDictTable.isSystemTable())
                        DirctTypeDes = "SystemTable";
                    if(_CurDictTable.isTmp())
                        DirctTypeDes = "Tmp table";
                    if(_CurDictTable.isView())
                        DirctTypeDes = "View";
    
                    if(_CurEDT == extend)
                    {
                        mm++;
                        info(strFmt("%1 - %2 %3[%4]; field name : %5[%6]",mm,
                                    DirctTypeDes,
                                    _CurDictTable.name(),
                                    _CurDictTable.label(),
                                    _CurDictField.name(),
                                    _CurDictField.label()));
                    }
                }
            }
        }
        info(int2str(mm));
    }
    

  • 相关阅读:
    open jdk卸载
    “玲珑杯”ACM比赛 Round #18---图论你先敲完模板(DP+思维)
    “玲珑杯”ACM比赛 Round #18--最后你还是AK了(搜索+思维)
    hdu 5116--Everlasting L(计数DP)
    HDU 5113--Black And White(搜索+剪枝)
    hdu 5573---Binary Tree(构造)
    HDU 5517---Triple(二维树状数组)
    hdu 5975---Aninteresting game(树状数组)
    hdu 5972---Regular Number(字符串匹配)
    HDU 4570---Multi-bit Trie(区间DP)
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1891298.html
Copyright © 2020-2023  润新知