我正在尝试更新SOLine的价格,并且通过调试看起来似乎是正确的,但更新的价格永远不会到达表格。我在下面的代码中遗漏了什么:
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();
答案 0 :(得分:0)
我终于找到了这个问题,我想与社区分享。在黑暗中拍摄,我打开SO301000以查看是否有任何阻止更改的逻辑,并发现在网格中标记为单位价格的列中显示的字段实际上是CuryUnitPrice而不是UnitPrice。我更改了我的代码以更新CuryUnitPrice,它就像一个魅力。获得的经验 - 检查表单以验证代码看起来不起作用的字段。