In Acumatica, I want to update UsrSendPONotifications checkbox(which is in PO screen) to true when I update a row in corresponding PO Receipt. This is the code that I tried & it is not working. So , UsrSendPONotifications checkbox remains false. Any idea about this?
protected void POReceipt_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e)
{
var row = (POReceipt)e.Row;
if (row == null) return;
else
{
POReceiptLine receiptLine = new PXSelect<POReceiptLine, Where<POReceiptLine.receiptNbr,
Equal<Required<POReceiptLine.receiptNbr>>>>(Base).Select(row.ReceiptNbr);
if(receiptLine == null) return;
else
{
POOrder poOrder = new PXSelect<POOrder, Where<POOrder.orderType,
Equal<Required<POOrder.orderType>>, And<POOrder.orderNbr,
Equal<Required<POOrder.orderNbr>>>>>(Base).Select(receiptLine.POType,
receiptLine.PONbr);
if(poOrder == null) return;
else
{
POOrderExt poExt = poOrder.GetExtension<POOrderExt>();
poExt.UsrSendPONotifications = true;
cache.SetValueExt<POOrderExt.usrSendPONotifications>
(poOrder,poExt.UsrSendPONotifications);
}
}
}