Fetch EDT property using X++

Hi All,

How to get the properties of EDT using X++ code. Property like ‘ButtonImage’ of an EDT. I’m using AX 4.0.

Regards,

Raghav.

This code works in AX2009 - it shouldn’t be much different in AX4:

#AOT
#Properties
str typeName = 'ActionDate';
TreeNode node = TreeNode::findNode(#ExtendedDataTypesPath + #AOTDelimiter + typeName);
str value = node.AOTgetProperty(#PropertyButtonImage);
;
info(value);

Thanks Martin,

The motto of finding ‘ButtonImage’ property of an EDT is to list out all the EDT’s of type ‘FilePath’ or ‘FileName’ (directory enabled). For the standard EDT like ‘FileName’ or ‘FilePath’ has ‘ButtonImage’ property as ‘OpenFile’.

Is this the correct procedure to list out all the EDT.

Regards,

Raghav.

I would prefer listing all data types that extend Filename type - I would look for something else only if this was not suitable by some reason. You could list them by a script like this:

Dictionary dictionary = new Dictionary();
SysDictType dictType;
int fileNameId = extendedTypeNum(Filename);
int i;

for (i = 1; i <= dictionary.typeCnt(); i++)
{
    dictType = new SysDictType(dictionary.typeCnt2Id(i));
    if (dictType && dictType.isExtending(fileNameId))
    {
        info(dictType.name());
    }
}