It works

static void Job5(Args _args)
{
    xInfo xInfo = new xInfo();

    treeNode t = xInfo.rootNode().AOTfindChild("DataDictionary").AOTfindChild("Tables");
    treeNode child;
    treeNode fields;
    treenodeIterator it, itFld;

    str   properties;
    str   table;
    str   field;
    str   extendedDataType;
    str   enumType;

    str   seachType = "ListCodeId";
    str   seachEnum = "ListCode";
    ;

    it = t.AOTiterator();
    child = it.next();
    while (child)
    {
        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");
            enumType         = findProperty(properties, "EnumType");

            if (extendedDataType == seachType)
            {
                info(strfmt("%1 / %2 - ExtendedDataType: %3", table, field, extendedDataType));
            }
            if (enumType == seachEnum)
            {
                info(strfmt("%1 / %2 - EnumType: %3", table, field, enumType));
            }
            fields = itFld.next();
        }
        child = it.next();
    }
}

Thanks Walter

-----Urspr�ngliche Nachricht-----
Von: Steeve Gilbert [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 7. Mai 2004 16:10
An: [EMAIL PROTECTED]
Betreff: RE : [development-axapta] How can I find (Axapta) Tables, who's field(s) contain a given extendedDataType?

I don't know any built-in functionality to do what you want but you can use TreeNode to browse the AOT.

TreeNode treeNode;
TreeNode nextField;

treeNode = xInfo.rootNode().AOTfindChild("Data Dictionary").AOTfindChild("Tables");
treeNode = treeNode.AOTfirstChild();
nextField = treeNode.AOTfindChild("Fields");
properties = nextField.AOTgetProperties();

Check in the help, add some while loop and you're on your way.

Steeve...

-----Message d'origine-----
De�: Walter Becker [mailto:[EMAIL PROTECTED]
Envoy�: 7 mai 2004 09:58
��: [EMAIL PROTECTED]
Objet�: [development-axapta] How can I find (Axapta) Tables, who's field(s) contain a given extendedDataType?

For example:
      I must find all Tables with Fields who's ExtendedDataTypes are 'ListCodeId'.

How can I accomplish this search with Program Code?
Is there perhaps already existing functionality in Axapta?

Walter Becker
DDT





Yahoo! Groups Links








Yahoo! Groups Links






[Non-text portions of this message have been removed]



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to