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();
}

Thanks in advance!
*This post is locked for comments
I have the same question (0)