Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Import data from excel in CustTable

Posted on by 205

I need to import from excel Customer(Arabic) name into "CustTable" this field is customized field   and the data stored in "CustTable". How can i Import that data. 

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,030 Most Valuable Professional on at
    RE: Import data from excel in CustTable

    You didn't say before that you're on Feature Pack. Here is a link explaining how to install DIXF there.

  • DEEPAKNONU Profile Picture
    DEEPAKNONU 205 on at
    RE: Import data from excel in CustTable

    Thanks for your response but Mr.DavidGunawan i tried this with excel it shows me you update 100 reccords but after refresh it'll not shows any update

  • DEEPAKNONU Profile Picture
    DEEPAKNONU 205 on at
    RE: Import data from excel in CustTable

    Thanks Mr.Chandan Sharma but i tried this one before but its not working

  • DEEPAKNONU Profile Picture
    DEEPAKNONU 205 on at
    RE: Import data from excel in CustTable

    thanks for response but Mr. Martin Drab in AX2012 Feature Pack Layer their is no any module for Data Import Export Framework it's available in AX2012 R2,R3. but i have ax2012.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,030 Most Valuable Professional on at
    RE: Import data from excel in CustTable

    The recommended way for importing data is the Data Import Export Framework.

  • Suggested answer
    DavidGunawan Profile Picture
    DavidGunawan 1,381 on at
    RE: Import data from excel in CustTable in AX2012

    Hi,

    You can use excel add-ins to export and import data from/to AX.

    For more detail in your case, you can follow the link below.

    ax2012exceldataimport.blogspot.sg/.../dynamics-ax-2012-customers-import-using.html

    With this you also able to import the customized field only and It's simpler (In the case of the Customer data is exist and you just want to update the customized field).

    Regards

  • Chandan Sharma Profile Picture
    Chandan Sharma 1,115 on at
    RE: Import data from excel in CustTable in AX2012

    You can create a job to import the data through excel as CSV doesnot supports arabic.

    the code will be somewhat as below

      custtable custtable ;

       SysExcelApplication application;

       SysExcelWorkbooks workbooks;

       SysExcelWorkbook workbook;

       SysExcelWorksheets worksheets;

       SysExcelWorksheet worksheet,worksheet1;

       SysExcelCells cells,cells1;

       COMVariantType type,type1;

       int row=0;

       int inserted =0;

       Accountnum  accountnum ;

       Dialog dialog;

       DialogField dfFileName;

       FileName fileName;

       #file

       #AviFiles

       ;

       dialog     = new Dialog("Pick the file");

       dfFileName = dialog.addField(extendedTypeStr(FileNameOpen));

       dialog.filenameLookupFilter(["All files", #AllFiles]);

       if(dialog.run())

       {

           filename =  dfFileName.value();

       }

       application = SysExcelApplication::construct();

       workbooks = application.workbooks();

       workbooks.open(filename);

       workbook = workbooks.item(1);

       worksheets = workbook.worksheets();

       worksheet = worksheets.itemFromName("ArabicNames");

       cells = worksheet.cells();

       do

       {

           row++;

           custtable .clear();

           accountnum = cells.item(row,1).value().bStr();

           custtable =custtable ::find(accountnum ,true);

           if(custtable .recid  > 0)

           {

               ttsBegin;

               custtable .ArabicName = cells.item(row,2).value().bStr(); //replace arabicname with your field

               custtable .update();

               inserted++;

               ttsCommit;

           }

           type = cells.item(row+1, 1).value().variantType();

       }

           while (type != COMVariantType::VT_EMPTY);

       info(strFmt("%1 records updated out of %2", inserted,row));

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans