比如,已知一个扩展类型是ProjCategoryId,下面的代码将为你找出所有使用过这个扩展类型的表。

 

static void findTableWithProjCategoryId(Args _args)

{

    xInfo xInfo = new xInfo();

 

    treeNode t = xInfo.rootNode().AOTfindChild("DataDictionary").AOTfindChild("Tables");

    treeNode childNode;

    treeNode fields;

    treenodeIterator it, itFld;

 

    str properties;

    str table;

    str field;

    str extendedDataType;

    str searchType = "ProjCategoryId";

    ;

 

    it = t.AOTiterator();

    childNode= it.next();

    while (childNode)

    {

      Table = child.treeNodeName();

      itFld = t.AOTfindChild(child.treeNodeName()).AOTfindChild("Fields").AOTiterator();

 

      fields = itFld.next();

      while (fields)

      {

        field = fields.treeNodeName();

        properties = fields.AOTgetProperties();

        extendedDataType = findProperty(properties, "ExtendedDataType");

 

        if (extendedDataType == searchType)

        {

          info(strfmt("%1 / %2 - ExtendedDataType: %3", table, field, extendedDataType));

        }

        fields = itFld.next();

      }

      childNode= it.next();

    }

}