I am trying to update the price of an SOLine and following through debug it seems to be correct, but the updated price never gets to the table. What am I missing in the code below:
SOOrderEntry soOrderEntry = PXGraph.CreateInstance<SOOrderEntry>();
//
//Added this line per Joshua's recommendation
soOrderEntry.Document.Current = soOrder;
//
bool orderUpdated = false;
foreach (EDImportExcept except in excepts)
{
if (except.ExceptReason == "P" && soOrder != null)
{
SOLine soLine = PXSelect<SOLine,
Where<SOLine.orderNbr, Equal<Required<SOLine.orderNbr>>,
And<SOLineExt.usrEDILineNbr,
Equal<Required<SOLineExt.usrEDILineNbr>>>>>
.Select(this, soOrder.OrderNbr, except.ItemLineNbr);
soLine.UnitPrice = except.EDIUnitPrice;
soOrderEntry.Transactions.Current = soLine;
soOrderEntry.Transactions.Update(soLine);
orderUpdated = true;
}
except.ExceptResolution = "A";
except.Active = false;
exceptMaint.Exception.Update(except);
exceptMaint.Actions.PressSave();
}
if (orderUpdated)
soOrderEntry.Actions.PressSave();
soOrderEntry.Actions.PressSave();in the loop - Samvel Petrosov