data import from excel to ax 2009 through x++ code only

Hi Developers,

Could please anyone provide code for data import from excel to ax 2009 through code only. In excel sheet i have three fields like location,transaction,money. So i ve to import this data into ax.

Pls anyone help me.

Thanks,

moulali.

please anyone help on this.

hi,

try this blog…

http://vasantharivali.wordpress.com/2010/08/19/import-excel-data-into-dynamics-ax-2009/

Hi Moulali,

  1. Save the file as .CSV
  2. Write small X++ program to import this file using AsciiIO class

AsciiIO was discussed many times here. Please search for them.

Hi AshNan,

Thank you very much for your help.

Hi Hrarish,

I was done the same as above you discussed. I got solution. Thanks for your answer.

Moulali

  • Hi harish,

i got everyone . But date is not inserting from excel to ax through x++. i will show my code

ttsbegin;
zsl.selectForUpdate(true);
zsl.Location = cells.item(row,1).value().bstr();
zsl.Totaldepositamount = cells.item(row,3).value().boolean();
zsl.Creationdate = cells.item(row,2).value().date(); // its is not insering.

zsl.insert();
ttscommit;

Could you please give the solution.

Thanks,

moulali.

hi ali…

zsl.Creationdate = cells.item(row,2).value().date();

u have to give 3 here…(row,3).value…because u already inserted two records…