Thursday, January 21, 2016

layer Objects through X++ in Ax 2012

// layer Objects in Ax 2012
static void San_LayerObjects(Args _args)
{
    #AOT
    treeNode      treeNode;
    xInfo         xInfo = new xInfo();
    UtilElements  utilElements;
    int counter = 0;
    textBuffer textBuffer = new textBuffer();
    dialog dialog = new dialog("Find the Modified objects by Layer Wise");
    dialogfield layerName;
    ;
    layerName = dialog.addField(enumStr(utilEntrylevel),"Choose the layer");
    if(dialog.run())
    {
        treeNode = treenode::findNode(#TablesPath);
        treeNode = treeNode.AOTfirstChild();
        while (treeNode)
        {
           if(SysTreeNode::existsInLayer(treeNode, layerName.value()))
           {
               textBuffer.appendText(treeNode.AOTname());
               textBuffer.appendText('\n');
               counter ++;
           }
          treeNode = treeNode.AOTnextSibling();
        }
    }
    if(strlen(textbuffer.getText()) > 0)
    {
        textBuffer.toFile(@"C:\Users\Gowtham\Desktop\TablemodifiedObjectInLayer.txt");
        info("Total modified objects in usr layer are " + int2str(counter));       
    }
}

No comments:

Post a Comment

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...