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 add AOT Fields to AOT table via X++?

(0) ShareShare
ReportReport
Posted on by 85

I tried to  add AOT Fields to AOT table via  below X++ in D365, but it get error "Unable to etract node content to disk. The file '%1' is read-only".

Can anyone give me a idea on  how  to add AOT Fields to AOT table via X++ in D365?

public static void main(Args _args)
{
        #AOT
        TreeNode tableNode;
        AotTableFieldList myAOTTablefieldList;
        SysDictTable sysDictTable = new SysDictTable(tablenum(TestTable));
        ;        
        myAOTTablefieldList = new AotTableFieldList();

        tableNode = TreeNode::findNode(#TablesPath+'\\'+sysDictTable.name());

        myAOTTablefieldList = TreeNode::findNode(#TablesPath+'\\'+sysDictTable.name() + "\\Fields");

        if(!myAOTTablefieldList.AOTfindChild("Name"))
        {
            myAOTTablefieldList.addString("Name");
        }

        tableNode.AOTsave();
    }

0184.error.jpg

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Another approach could be like since now, objects are stored as xml files, those files could be directly opened and edited as xml files.

    Fields could be added using a similar to below node. I guess a refresh of AOT would be required to view the fields in front end.

    <Fields>

    <AxTableField xmlns=""

    i:type="AxTableFieldString">

    <Name>Name</Name>

    <ExtendedDataType>FMRentalAdditionName</ExtendedDataType>

    <Mandatory>Yes</Mandatory>

    </AxTableField>

    </Fields>

  • André Arnaud de Calavon Profile Picture
    301,231 Super User 2025 Season 2 on at

    Hi Fred,

    AOTsave is not working as the development environment and runtime are split. You cannot edit the AOT on runtime. What are you exactly trying to achieve?

  • Fred Xu Profile Picture
    85 on at

    I want to add a new field to a table when a button is clicked on a form. Then display the new field on form, and user can specify a value to the new field.

  • Fred Xu Profile Picture
    85 on at

    Thanks, is there a way  to get xml file path for the table?

  • Martin Dráb Profile Picture
    237,996 Most Valuable Professional on at

    Your technical design can't be implemented. If you explain the business problem you tried to solve by this design, we may be able to suggest an alternative that is possible.

    There won't be any XML to edit in production; source code isn't deployed there.

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