如何启用 Acumatica 中的字段 - 状态为 "shipping" 的销售订单?

How to enable field in Acumatica - Sales Order with "shipping" status?

我需要添加到销售订单屏幕的自定义字段始终处于启用状态,即使订单已发货,订单状态为 "Shipping"。 我已经扩展了 SOOrder_RowSelected 方法来启用自定义字段,但是当订单处于 "Shipping" 状态时该字段仍然被禁用。

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
    public virtual void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
    {
        SOOrder row = e.Row as SOOrder;
        if (row == null)
            return;

        if (del != null)
            del(cache, e);

       PXUIFieldAttribute.SetEnabled<SOOrderExt.usrContact>(cache, null, true);
    }
}

尝试使用 protected virtual void 代替 public virtual void。还要检查天气 del 执行不会产生异常(在我生命中的某个时候我遇到过这种情况)。

protected virtual void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
    {
        SOOrder row = e.Row as SOOrder;
        if (row == null)
            return;

        try{
        if (del != null)
            del(cache, e);
        }
        catch(Exception ex)
        { 
             //check for surprises
        }

       PXUIFieldAttribute.SetEnabled<SOOrderExt.usrContact>(cache, null, true);
    }

另一个感兴趣的领域是检查您或其他人是否通过自动化步骤enabling/disabling修改了它