2

I need custom field that I added to Sales Order screen to be always enabled even order has been shipped, order having "Shipping" status. I have extended SOOrder_RowSelected method to enable the custom field but the field is still disabled when the order is in "Shipping" status.

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);
    }
}
4

1 回答 1

3

尝试而不是public virtual void使用protected 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);
    }

另一个感兴趣的领域可能是检查您或其他人是否通过自动化步骤对其进行了启用/禁用

于 2015-04-08T08:03:42.120 回答