Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

RE: How to rename elements of an object

$
0
0

you must read about SysDictEnum

SysDictEnum dictEnum = new SysDictEnum( enumnum(YYYEnum) ); 
    int valueIndex;
    
    TreeNode TreeNode;
    TreeNode node;
    
    str oldName;
    str newName;
    #Properties
    #AOT
    
    
    for (valueIndex = 0 ; valueIndex < dictEnum.values(); valueIndex++)
    {
        //labelId = dictEnum.index2LabelId(valueIndex);
        //info(SysLabel::labelId2String2(labelId, languageId));
        node = TreeNode::findNode(dictEnum.path() + '\\' + dictEnum.index2Symbol(valueIndex));   
        oldName = node.AOTgetProperty("Name");
        info(oldName);
        newName = strdel(oldName,1,3);
        node.AOTsetProperty(#PropertyName, "YYY"+newName);
        node.AOTsave();
        node.treeNodeRelease();
        node = null;
    }



Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>