web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

to import vendor through excel in ax 2012

(0) ShareShare
ReportReport
Posted on by 371

want to import the vendor through excel in a 2012 and the company is "INMF" code to import through is excel..

the fields are :- ACCOUNT NUM, NAME ALIAS, VENDOR NAME, VENDOR GROUP, CURRENCY, COUNTRY, STATE ZIPCODE,STREET,ADDRESS, CITY, EMAIL CELL PHONE, PHONE, SITE ID, PAYMENT, TERM, TIN NO,

*This post is locked for comments

I have the same question (0)
  • Prashant Singh Profile Picture
    8,802 on at

    Dear Vinay,

    Please correct the tag. It should AX 2012 .

    atinkerersnotebook.com/.../using-excel-to-import-customers-and-vendors-in-dynamics-ax-2012

    Please follow above link. It will help you to do so.

    Also you can import vendor through dmf.

    Regards,

    Prashant Kumar

  • CU02060633-1 Profile Picture
    371 on at

    @Prashant Kumar...thanx for the reply want to o with the help of the X++ code

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Vinay Tak,

        Here is the code similar to your solution! Please try this.

    static void InsertRecords(Args _args)
    {
         SysExcelApplication application;
         SysExcelWorkbooks workbooks;
         SysExcelWorkbook workbook;
         SysExcelWorksheets worksheets;
         SysExcelWorksheet worksheet;
         SysExcelCells cells;
         COMVariantType type;
         Name name;
         FileName filename;
         int row =1;
         int i=0;
         VendTable           vendTableLoc;
         AccountNum          accountNum;
         str                 VendGroup;
         Dialog dialog;
         DialogField dialogField;
         ;
         application = SysExcelApplication::construct();
         workbooks = application.workbooks();
         dialog = new Dialog("FileOpen");
         dialogfield = dialog.addField(extendedTypeStr(Filenameopen), "File Name");
         dialog.run();
    
         if (dialog.run())
         {
            filename = (dialogfield.value());
         }
         try
         {
         workbooks.open(filename);
         }
         catch (Exception::Error)
         {
         throw error("File cannot be opened.");
         }
         workbook = workbooks.item(1);
         worksheets = workbook.worksheets();
         worksheet = worksheets.itemFromNum(1);
         cells = worksheet.cells();
         do
         {
             ttsBegin;
         row++;
         accountNum     = cells.item(row, 1).value().bStr();
         VendGroup      = cells.item(row, 2).value().bStr();
    vendTableLoc = VendTable::find(accountNum,true);

    vendTableLoc.VendGroup = VendGroup; vendTableLoc.insert(); ttsCommit; i++; type = cells.item(row+1, 1).value().variantType(); } while (type != COMVariantType::VT_EMPTY); application.quit(); info("Done"); info(strFmt("%1", i)); }


    Thanks

    Suresh

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi Vinay Tak,

    You don't need to write x++ code, use DMF to import vendors shafeaa.blogspot.co.nz/.../import-vendors-using-data-import.html

    Use standard functionality instead of custom solution you need to write, test and mintain.

  • Suggested answer
    Faisal Fareed Profile Picture
    10,796 User Group Leader on at

    Hi Vinay,

    Though there can be many ways to import an entity (e.g. Customer) in AX 2012 however, based on the list of fields you want to import data for I found best-written article here [View:http://ax2012xppdataimport.blogspot.com.au/2013/02/microsoft-dynamics-ax-2012-xpp.html:750:50]  which explains each and every field related to customer e.g. postal address, electronic address etc.

    Above approach is best if you still want to write code to import otherwise Data import export framework is there for you to do all job.

  • Naman Jaju Profile Picture
    10 on at

    Can you please explain this code?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans