Interview Questions

Thursday, March 13, 2014

How to import data from excel file to AX2012

static void XML2AXTABLE(Args _args)
{
MyTables mt;
XMLDocument XMLdoc = XMLDocument::newFile(@"D:\\ABC\\accounts.xml");
int i,CountItemtags=100;
;
XMLdoc.load(XMLdoc.toString());

for (i = 0 ; i < countItemTags; i++)
{
mt.AccountNum =( xmldoc.getElementsByTagName('AccountNum').item(i).text());
mt.BankAccount=( xmldoc.getElementsByTagName('BankAccount').item(i).text());
countItemTags = xmldoc.getElementsByTagName('AccountNum').length();
mt.insert();
}


}

No comments:

Post a Comment