static void Create_Table_with_Code(Args _args)
{
SysDictTable sysdictTable;
treenode trv;// its a class
AOTTableFieldList fieldnode;
str prop;
int pos;
#AOT
#Properties
;
//#Table path refer the \\Data Dictionary\\Tables and finding the path
trv = treenode::findNode(#TablesPath);
//AOTadd method is to add table in tables//AAA is table name
trv.AOTadd('AAA');
trv = trv.AOTfindChild('AAA');
trv.AOTcompile(1);
trv.AOTsave();
trv.AOTfindChild('AAA');
fieldnode = trv.AOTfirstChild();
fieldnode.addString('AccountNum');
fieldnode = fieldnode.AOTfindChild('AccountNum');
prop = fieldnode.AOTgetProperties();
pos = findPropertyPos(prop,#PropertyExtendeddatatype); //find right place to put extended data type
pos = strFind(prop,'ARRAY',pos,strLen(prop));
pos = strFind(prop,'#',pos,strLen(prop));
prop = strins(prop,extendedTypeId2name(ExtendedtypeNum(CustAccount)),pos + 1);
// insert field of extended data type 'CustAccount'
fieldnode.AOTsetProperties(prop);
trv.AOTcompile(1);
trv.AOTsave();
trv.AOTRestore(); //to load assigned extended data type properties
sysdictTable = sysdictTable::newTreeNode(trv);
appl.dbSynchronize(sysdictTable.id());
}
This blog is for Dynamics AX (AXAPTA) Developers,this will help you for your development issues. This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use.
04 October 2010
Subscribe to:
Post Comments (Atom)
DB restore production DB to DEV environment in D365 FO using Bacpac file
https://www.linkedin.com/pulse/restore-production-database-dev-environment-d365fo-using-abbas-tfwbe SQLPackage link : https://www.linkedin...
-
static void createForm(Args _args) { Args args; Form form; FormRun formRun; FormBuildDesign formBuildDesign; FormB...
-
Please click here to access Custom Workflow step by step process:
-
1. In classDeclaration extend SrsReportDataProviderPreProcess instead of SrsReportDataProviderBase 2. Temp table properties should b...
How to print child nodes we r giving only parent node using x++ code
ReplyDelete