Friday, May 25, 2012

Code for Traverse between Tables and all the fields

With reference of Bineet's blog here I found the code for Traverse between tables and all the fields.


//Travese between tables and for each table traverse between all the fields
static void TeeNode_traverse(Args _args)
{
    TreeNode            treeNode, treeNodeTable;
    TreeNodeIterator    iterator;
    void traverseFields(TreeNode _treeNode)
    {
        TreeNode parentNode;
        parentNode = _treeNode.AOTfindChild(‘Fields’);
        //treeNodeTable = _treeNode.AOTfirstChild();
        iterator = parentNode.AOTiterator();
        parentNode = iterator.next();
        while(parentNode)
        {
            //treeNodeTable = treeNodeTable.AOTfirstChild();
            parentNode = iterator.next();
        }
    }
    ;
    treeNode = TreeNode::rootNode();
    treeNode = treeNode.AOTfirstChild();
    treeNodeTable = treeNode.AOTfindChild(‘Tables’);
    treeNodeTable = treeNodeTable.AOTfirstChild();
    while(treeNodeTable)
    {
        traverseFields(treeNodeTable);
        treeNodeTable = treeNodeTable.AOTnextSibling();
    }
}

No comments:

Post a Comment

I will appreciate your comments !

Download large bacpac (sandbox database) to DEV environment much faster

As the LCS website gets slower and slower and the database backups get bigger and bigger.  Use AZCopy to download objects out of LCS asset l...