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

How to rename elements of an object

$
0
0

Dear All,

I have a requirement where I need to change the naming conventions of objects and elements of objects.

static void EDRenaming(Args _args)
{
    UtilIdElements utilId;
    str s;
    TreeNode TreeNode;
    TreeNode node;
    str oldName;
    str newName;
    #Properties
    #AOT
    ;
    while select utilId where utilid.recordType == UtilElementType::Enum
    && utilId.name like 'XXX*'
    {
       s = utilId.name;

       node = TreeNode::findNode(#BaseEnumsPath + "\\" + s);
       oldName = node.AOTgetProperty("Name");
       newName = strdel(oldName,1,3);
       node.AOTsetProperty(#PropertyName, "YYY"+newName);
       node.AOTsave();
       node.treeNodeRelease();
       node = null;
    }
}

Here I got the logic to change the name of enum from XXXEnum to YYYEnum, but I didnt get the logic to change the element name i.e., XXXElement1 to YYYElement1..

Can anyone please help me out...


Viewing all articles
Browse latest Browse all 175888

Trending Articles



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