Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

How to Import Excel Data in Invent Movement Journal IN AX 2012.

Posted on by 61

Error Show me :The number of arguments provided is different from the number of arguments accepted by the method.

I debug my code . where in loop 

row++;    this error show me in box.

  • Fawad Ahmad Profile Picture
    Fawad Ahmad 61 on at
    RE: How to Import Excel Data in Invent Movement Journal IN AX 2012.

    void clicked()

    {

         SysExcelApplication    application;

         COMVariantType          type;

         //COMVariant              value;

         InventDim              _inventdim;

         SysExcelCells           cells;

         int row=1;

       //...Table's Object Created

       do

       {

          row++;

       InventJournalTrans.TransDate =str2DateDMY(Ahmad_BankAccountDuplication.ExcelCellContent(row,1)   );

       InventJournalTrans.ItemId =(Ahmad_BankAccountDuplication.ExcelCellContent(row,2)   );

       inventdim.configId =(Ahmad_BankAccountDuplication.ExcelCellContent(row,3)   );

       inventdim.InventSizeId =(Ahmad_BankAccountDuplication.ExcelCellContent(row,4)   );

       inventdim.InventColorId =(Ahmad_BankAccountDuplication.ExcelCellContent(row,5)   );

       inventdim.InventLocationId =(Ahmad_BankAccountDuplication.ExcelCellContent(row,6)   );

       inventdim.InventSiteId =(Ahmad_BankAccountDuplication.ExcelCellContent(row,7)   );

       inventdim.inventBatchId =(Ahmad_BankAccountDuplication.ExcelCellContent(row,8)   );

       inventdim.wMSLocationId =(Ahmad_BankAccountDuplication.ExcelCellContent(row,9)   );

       inventdim.inventSerialId =(Ahmad_BankAccountDuplication.ExcelCellContent(row,10)   );

       InventJournalTrans.MZNPurchUnit =(Ahmad_BankAccountDuplication.ExcelCellContent(row,11)   );

       InventJournalTrans.Qty =any2real(Ahmad_BankAccountDuplication.ExcelCellContent(row,12)   );

        //InventJournalTrans.LedgerDimension=str2int(Ahmad_BankAccountDuplication.ExcelCellContent(2,13)   );

        _inventDim=inventDim::findOrCreate(inventDim);

         InventJournalTrans.InventDimId = _inventDim.inventDimId;

       ////...Info

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,1)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,2)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,3)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,4)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,5)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,6)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,7)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,8)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,9)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,10)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,11)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,12)  );

         info ("Cell Content is     "+Ahmad_BankAccountDuplication.ExcelCellContent(2,13)  );

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

    }

    while (type  != COMVariantType::VT_EMPTY);

    application.quit();

       //info(strFmt("show row/column values: row %1, col %2", row, col));

    }

  • Komi Siabi Profile Picture
    Komi Siabi 12,692 Most Valuable Professional on at
    RE: How to Import Excel Data in Invent Movement Journal IN AX 2012.

    Hello Fawad,

    Please share your code with us for possible help.

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans