How do I get a list of methods on a table?

In Microsoft Dynamics AX, how do I get the list of methods in a table from C #?

+2


source to share


1 answer


The below X ++ method takes a table name as a parameter and returns an ArrayList of methods. You can call static X ++ methods from your C # code (you need the .Net Business Connector for this).



public static System.Collections.ArrayList getTableMethods(str _tableName)
{
    SysDictTable sdt;
    TreeNode tn;
    TableId tableId;
    MethodInfo methodInfo;
    System.Collections.ArrayList methodArr;
    #AOT
    ;

    tableId = tableName2id(_tableName);

    sdt = SysDictTable::newTableId(tableid);

    methodArr = new System.Collections.ArrayList();
    tn = TreeNode::findNode(#TablesPath + "\\" + _tableName + "\\" + "Methods");
    tn = tn.AOTfirstChild();
    while(tn)
    {
        methodArr.Add(tn.AOTname());
        tn = tn.AOTnextSibling();
    }

    return methodArr;
}

      

+1


source







All Articles