【问题标题】:How to enable grid field in Acumatica - Adjustments如何在 Acumatica 中启用网格字段 - 调整
【发布时间】:2019-04-03 15:45:42
【问题描述】:
这是我启用网格并输入数据的代码,但它不起作用。
protected void ARAdjust_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
ARInvoice rInvoice = Base.Document.Current;
if (rInvoice.DocType == ARDocType.DebitMemo)
{
Base.Adjustments_2.AllowInsert = true;
}
}
这是尚未启用网格的图像。
【问题讨论】:
标签:
acumatica
acumatica-kb
【解决方案1】:
调整视图在主视图 (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;
}
}