Interview Questions

Wednesday, May 14, 2014

Copy Data From Xml File to Table in ax 2012

static void XML2AXTABLE(Args _args)
{
    MyTables mt;
    XMLDocument XMLdoc = XMLDocument::newFile(@"D:\\Somendra\\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