Hi,
I have my working code already and it is adding salineLine correctly but I'm not sure if this is the right way because when I changed the Sales Quantity value of the auto populated salesline using the interface the SalesPrice return to its original value which is the Sales Base Price.
Below is my code
SalesLine salesLine; InventDim inventDim; InventTable inventTable; salesLine.clear(); inventDim = null; salesLine.initValue(); salesLine.SalesId = salesTable.SalesId; salesLine.initFromSalesTable(salesTable); salesLine.ItemId = '123'; inventTable = InventTable::find(salesLine.ItemId); salesLine.initFromInventTable(inventTable); inventDim.initFromInventTable(inventTable); salesLine.InventDimId = InventDim::findOrCreate(inventDim).InventDimId; salesLine.SalesQty = 1; salesLine.SalesPrice = 3200.00; salesLine.LineAmount = salesLine.calcLineAmount(); salesLine.createLine(true,true,false,true);
*This post is locked for comments