web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to read Table Method and classes Method content through X++ code & store in some medium(table memo field, xml file etc.)

(0) ShareShare
ReportReport
Posted on by 75

Hi all, 

I have a requirement wherein I need to traverse to the ABC table, find Fields, IndexID's etc., and store the names of Fields, IndexID's, method etc. into XYZ table. - This is done.

similar I'm able to Traves from table to a method node and store method name in the table, along with the table.method name I need to read the table.method content(code) and store in XYZ table memo fields.

How to read the table.method() code? Any help

Thanks in advance and 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    Hi GopalRC,

    You can use treeNode.AOTgetSource() method and you can get treeNode using something like:

    #AOT
    treeNode  = TreeNode::findNode(#ClassesPath + @'\testClass\test_method');

  • GopalRC Profile Picture
    75 on at

    Hi Ievgen Miroshnikov,

    I have already tried the similar way you said in earlier reply.

    treeNode  = TreeNode::findNode(#TablesPath+@"\"+_tableName+@"\"+_dictTable.objectMethod(i));  // _tableName and _dictTable.objectMethod(i) are parameter 

        this return me Null "treeNode" value.

    if use same without method name parameter it returns me the path.

        treeNode  = TreeNode::findNode(#TablesPath+"\\"+_tableName)                      

    Any other suggestions?

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    I missed 'methods', this works

    TreeNode treeNode  = TreeNode::findNode(#TablesPath + #AOTDelimiter + identifierStr(CustTable) + #MethodsPath +  #AOTDelimiter + 'address');

  • Suggested answer
    GopalRC Profile Picture
    75 on at

    Ton's of thank you. It works! :-)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans