Obtain an ax Data Dictionary

Source: Internet
Author: User
Ax provides a lot of reflection classes to get metadata information. A colleague just needs a list of ax data dictionaries and writes one easily. There is no technical content. Here we will back up the data, so that you can copy and paste it later. Static   Void Datadictionary (ARGs _ ARGs)
{
# AOT
# Define . Filename (@ "D: \ datadictionary.txt ")
Textbuffer TB =   New Textbuffer ();
Treenode = Treenode: findnode (# tablespath );
Dicttable;
Dictfield;
Int I;
;

Treenode = Treenode. aotfirstchild ();

While (Treenode)
{
Dicttable =   New Dicttable (tablename2id (treenode. aotname ()));
TB. appendtext (dicttable. Name () + '   ' + Dicttable. Label ());
TB. appendtext ( ' \ N ' );
For (I = 1 ; I <= Dicttable. fieldcnt (); I ++ )
{
Dictfield =   New Dictfield (dicttable. ID (), dicttable. fieldcnt2id (I ));
TB. appendtext ( ' ' + Dictfield. Name () + '   '   + Dictfield. Label ());
TB. appendtext ( ' \ N ' );
}

Print treenode. aotname ();
Treenode = Treenode. aotnextsibling ();

}
TB. tofile (# filename );

}

You can also use dictionary to get the table instead of treenode. Static   Void Datadictionary2 (ARGs _ ARGs)
{
# AOT
# Define . Filename (@ "D: \ datadictionary.txt ")
Textbuffer TB =   New Textbuffer ();
Dictionary dictionary =   New Dictionary ();

Dicttable;
Dictfield;
Int I;
Int J;
;

For (I = 1 ; I <= Dictionary. tablecnt (); I ++ )
{
Dicttable =   New Dicttable (dictionary. tablecnt2id (I ));
TB. appendtext (dicttable. Name () + '   ' + Dicttable. Label ());
TB. appendtext ( ' \ N ' );
For (J = 1 ; J <= Dicttable. fieldcnt (); j ++ )
{
Dictfield =   New Dictfield (dicttable. ID (), dicttable. fieldcnt2id (j ));
TB. appendtext ( ' ' + Dictfield. Name () + '   '   + Dictfield. Label ());
TB. appendtext ( ' \ N ' );
}

Print dicttable. Name ();
// Treenode = treenode. aotnextsibling ();

}
TB. tofile (# filename );

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.