Tuesday, July 3, 2018

Get Lines of code modified in util Level Layer AX 2012

//Get Lines of code modified in util Layer

static void getCodeLinesByObjectsInAOT(Args _args)
{
    #File
    #AOT
    TreeNode        treeNode;
    UtilElements    utilElements;
    container       getObjectName;
    SysScannerClass scanner;
    int             i;
    int             getLinesCount;
    ;
    while select utilElements
        where utilElements.recordType == UtilElementType::Table
            //&& utilElements.utilLevel == UtilEntryLevel::CUS
                && utilElements.name == 'InventTable'
    {
        getObjectName += [utilElements.name];
    }

    //CUS code
    for (i = 1; i <= conLen(getObjectName); i++)
    {

        treeNode    = infolog.findNode(#TablesPath + #AOTDelimiter + conPeek(getObjectName, i) + #AOTDelimiter +'Methods' );
        treeNode = SysTreeNode::nodeInLayer(treeNode,UtilEntryLevel::CUS);

        treeNode = treeNode.AOTfirstChild();

        while (treeNode)
        {
            if (treeNode.getNodeInLayer(UtilEntryLevel::CUS))
            {
                scanner = new SysScannerClass(treeNode);
                getLinesCount += scanner.lines();
            }

            treeNode = treeNode.AOTnextSibling();
        }
    }
}

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...