Hi Expert.
I try disale field So Notes depends on the condition of the shipment in below:
I try set break point at:
PXUIFieldAttribute.SetEnabled(cache, row, true);
PXUIFieldAttribute.SetEnabled<SOOrderExt.usrSoNote>(cache, row, true);
break point ok, program touch here.
protected void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
var row = (SOOrder)e.Row;
if (row != null && row.OrderNbr != null)
{
Base.Document.Cache.AllowUpdate = true;
Base.Transactions.Cache.AllowUpdate = true;
SOOrderShipment ship = PXSelect<SOOrderShipment, Where<SOOrderShipment.orderNbr, Equal<Required<SOOrderShipment.orderNbr>>>>.Select(Base, row.OrderNbr.Trim());
if (ship != null && ship.ShipmentNbr != null)
{
SOShipment shipment = PXSelect<SOShipment, Where<SOShipment.shipmentNbr, Equal<Required<SOShipment.shipmentNbr>>>>.Select(Base, ship.ShipmentNbr.Trim());
if (shipment != null && shipment.Status != null && !ConstantsSO.SHIP_STATUS_OPEN.Equals(shipment.Status))
{
PXUIFieldAttribute.SetEnabled(cache, row, false);
PXUIFieldAttribute.SetEnabled<SOOrderExt.usrSoNote>(cache, row, false);
}
else
{
PXUIFieldAttribute.SetEnabled(cache, row, true);
PXUIFieldAttribute.SetEnabled<SOOrderExt.usrSoNote>(cache, row, true);
}
}
else
{
PXUIFieldAttribute.SetEnabled(cache, row, true);
PXUIFieldAttribute.SetEnabled<SOOrderExt.usrSoNote>(cache, row, true);
}
}
}
but this field still enable
Can you help me? Thank you so much.