In the Sales Order Lines, if the Item you add does not have stock, the Replace by Alternate Item will be prompted (when you save it)
it looks like this:

I have this code which adds Item Number / Sales Order Lines by button click,
now i need to run the Replace by Alternate Item in my code.
can you help me achieve it?
here's my code:
void clicked()
{
SalesLine.clear();
SalesLine.SalesId = SalesTable.SalesId;
SalesLine.ItemId = '0000000003';
SalesLine.InventDimId = InventDim::findOrCreate(inventDim).inventDimId;
salesline.initFromSalesTable(salestable);
SalesLine.itemIdChanged();
SalesLine.validateWrite();
SalesLine.createLine();
SalesLine_ds.refresh();
SalesLine_ds.executeQuery();
}
-----------------
PS. im using the code to make a import from excel button, i just need to run the Replace by Alternate Item for now.
please help me, thanks.
*This post is locked for comments
I have the same question (0)