调整视图在主视图 (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;
}
}