Rename AOT Object

static void RenameAOTObj(Args _args)
{
    #AOT
    UtilElements            utilElements;
    TreeNode                treeNodeObj;
    str                     newPe="NT",newName;
    
    while select utilElements where utilElements.utilLevel==utilEntryLevel::usr
                               &&utilElements.recordType==  utilElementType::Table
                               &&utilElements.name like "ST*"
    {
        treeNodeObj = TreeNode::findNode(#TablesPath);
        treeNodeObj = treeNodeObj.AOTfindChild(utilElements.name);
        if(treeNodeObj)
        {        
            newName=newPe+subStr(utilElements.name,3,strLen(utilElements.name));
            treeNodeObj.AOTRename(newName);//AX2012
       //treeNodeObj.AOTsetProperty("Name","newName");//AX2009 treeNodeObj.AOTcompile(); } } }

 

posted @ 2016-09-12 15:14  止在入门  阅读(222)  评论(0编辑  收藏  举报