Hi all
I've successfully imported data from Excel into Axapta using Excel definition groups. However can these definition groups be used to update existing Axapta records (ie. We made a whole heap of changes to the description fields of our item inventory in excel and we want to update these changes to the same items in axapta).
Thanks for your help
George
0
Comments
I would recommend you to create job to transfer your data to Axapta.
MikeR (Axapta developer)
Under normal circumstances I would, however axapta aleady has sales order transactions on the items therefore I can't just recreate them. I need to find a way to transfer the changes that were made in excel into axapta. We have around about 4000 inventory items to import.
George
So, what are you intend to change?
1 Item fields
2 Dimension fields
3 Or Invent Trans?
MikeR (Axapta developer)
As far as I can see you only need to download some changes from Excel to Axapta
May be this code will help you
Define variables
COM application, workBooks, workSheets, currentWorkSheet, cell;
str fileName;
At first you need to get access to the Excel
fileName = WINApi::getOpenFileName(0, [("@SYS28576"+' (*.xls)'), '*.xls'],'', 'Open File whith data ');
application = new COM('Excel.application');
workBooks = application.workBooks();
workBooks.open(fileName);
workSheets = application.worksheets(); //Get access to the collection of worksheets
currentWorkSheet = workSheets.item(1);// Get access to the workSheets
Than you need to get access to the cell
cell = COM::createFromVariant(cellsOnSheet.item(curRow, 1));
cellValue = convertVariant2Str(cell.value());
Next select ItemId from Invent Table and update ItemName, Item Price,
Item Group and others
But better create special class for this, so you must done a lot of Checks.