0

这是我启用网格并输入数据的代码,但它不起作用。

   protected void ARAdjust_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
    {

        ARInvoice rInvoice = Base.Document.Current;

        if (rInvoice.DocType == ARDocType.DebitMemo)
        {
            Base.Adjustments_2.AllowInsert = true;

        }
    }

这是尚未启用网格的图像。

在此处输入图像描述

4

1 回答 1

3

调整视图在主视图 (DAC APInvoice) 行选择事件中设置。我将覆盖此事件并在调用基本方法后添加您的更改。像这个例子:

public class APInvoiceEntryTestExtension : PXGraphExtension<APInvoiceEntry>
{
    public virtual void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
    {
        del?.Invoke(cache, e);
        var row = (APInvoice)e.Row;
        if (row?.DocType != ARDocType.DebitMemo)
        {
            return;
        }

        Base.Adjustments.AllowInsert = true;

        //  FROM BASE CALL:
        //    Adjustments.Cache.AllowInsert = false;
        //    Adjustments.Cache.AllowDelete = false;
        //    Adjustments.Cache.AllowUpdate = !invoiceState.IsRetainageDebAdj &&
        //    invoiceState.IsDocumentRejectedOrPendingApproval || invoiceState.IsDocumentApprovedBalanced
        //        ? !invoiceState.IsDocumentRejected
        //        : Transactions.Cache.AllowUpdate && !invoiceState.IsDocumentPrebookedNotCompleted;
        }
}
于 2019-04-04T13:16:20.963 回答