i need the manual coded.
i tried using the link you suggested:
erpdax.wordpress.com/.../importing-sales-order-sales-lines-from-excel-file
im modifying it on my terms, but im only guessing and trying it.
the code given also creates a Sales Order, i only need to create the Lines, i tried deleting the code that inserts the Sales Order, but there's no results.
can you help me modify this codes:
------------------------
static void MultiSalesOrdersLineImportfromExcel(Args _args)
{
//SalesTable salesTable;
//SalesLine salesLine;
//InventDim inventDim;
NumberSeq num;
SysExcelApplication application;
SysExcelWorkbooks workbooks;
SysExcelWorkbook workbook;
SysExcelWorksheets worksheets;
SysExcelWorksheet worksheet,worksheet1;
SysExcelCells cells,cells1;
COMVariantType type;
int row;
;
application = SysExcelApplication::construct();
workbooks = application.workbooks();
workbooks.open('C:\\Users\\mycomputer\\Desktop\\Import.xlsx');
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromName("Header");
worksheet1 = worksheets.itemFromName("Lines");
cells = worksheet.cells();
cells1 = worksheet1.cells();
num = NumberSeq::newGetNum(SalesParameters::numRefSalesId());
salesTable.SalesId = num.num();
//salesTable.CustAccount = cells.item(1,1).value().bStr();
//salesTable.initValue(SalesType::Sales);
//salesTable.initFromCustTable();
//if(salesTable.validateWrite())
//{
//salesTable.insert();
//}
do
{
row++;
inventDim.clear();
inventDim.InventSizeId = int2str(real2int(cells1.item(row,2).value().double()));
inventDim.InventColorId = int2str(real2int(cells1.item(row,3).value().double()));
inventDim.InventStyleId = int2str(real2int(cells1.item(row,4).value().double()));
salesLine.clear();
salesLine.initValue(salesTable.SalesType);
salesLine.initFromSalesTable(salesTable);
salesLine.ItemId = cells1.item(row, 1).value().bStr();
salesLine.initFromInventTable(InventTable::find(cells1.item(row, 1).value().bStr()));
salesLine.InventDimId = InventDim::findOrCreate(inventDim).inventDimId;
salesLine.SalesQty = any2int(cells1.item(row,5).value().toString());
//salesLine.RemainSalesPhysical = salesLine.SalesQty;
//salesLine.SalesUnit = cells1.item(row,3).value().bStr();
//salesLine.QtyOrdered = salesLine.calcQtyOrdered();
//salesLine.RemainInventPhysical = salesLine.QtyOrdered;
//salesLine.setPriceDisc(InventDim::find(salesLine.InventDimId));
type = cells1.item(row+1, 1).value().variantType();
if (salesLine.validateWrite())
{
salesLine.insert();
}
}
while (type != COMVariantType::VT_EMPTY);
workbooks.close();
application.quit();
info("Done!");
}
----------------------------