当我创建新发票或从SOOrderEntry->发货 - >发票准备发票时,我在SOInvoiceEntry.cs上遇到问题,在用户点击另一个相关字段之前,尚未输入invoiceNbr那个DAC
在按下与DAC关联的字段之前我创建了一个名为UsrKSFSCCom的新DAC
在dac中有许多isKey字段
[PXDBString(50, IsKey = true, IsUnicode = true, InputMask = "")]
[PXDBDefault(typeof(ARInvoice.refNbr))]
[PXUIField(DisplayName = "InvoiceNbr")]
public string UsrInvoiceNbr { get; set; }
public class usrInvoiceNbr : IBqlField{}
我有一个ARInvoice_Rowselecting事件处理程序设置如下
protected virtual void ARInvoice_RowSelecting(PXCache sender, PXRowSelectingEventArgs e, PXRowSelecting InvokeBaseHandler)
{
if (InvokeBaseHandler != null)
InvokeBaseHandler(sender, e);
ARRegister row = (ARRegister)e.Row;
if (row == null) return;
ARRegisterExt rowExt = PXCache<ARRegister>.GetExtension<ARRegisterExt>(row);
ARTran invoiceCust = PXSelect<ARTran,
Where<ARTran.refNbr,
Equal<Required<ARTran.refNbr>>>>.Select(Base, row.RefNbr);
if (invoiceCust == null)
return;
SOOrder salesOrd = PXSelect<SOOrder,
Where<SOOrder.orderNbr,
Equal<Required<SOOrder.orderNbr>>>>.Select(Base, invoiceCust.SOOrderNbr);
UsrKSFSCCom fscComDef = PXSelect<UsrKSFSCCom,
Where<UsrKSFSCCom.usrInvoiceNbr,
Equal<Current<ARInvoice.refNbr>>>>.Select(Base, row.RefNbr);
if (salesOrd == null)
return;
SOOrderExt saleOrdExt = PXCache<SOOrder>.GetExtension<SOOrderExt>(salesOrd);
fscComDef.UsrInRep = saleOrdExt.UsrInRep;
fscComDef.UsrInCom = saleOrdExt.UsrInCom;
fscComDef.UsrManRep = saleOrdExt.UsrManRep;
fscComDef.UsrManCom = saleOrdExt.UsrManCom;
fscComDef.UsrMiscRep = saleOrdExt.UsrMiscRep;
fscComDef.UsrMiscCom = saleOrdExt.UsrMiscCom;
fscComDef.UsrOutRep = saleOrdExt.UsrOutRep;
fscComDef.UsrOutCom = saleOrdExt.UsrOutCom;
fscComDef.UsrIndirectCust = saleOrdExt.UsrIndirectCust;
fscComDef.UsrOverBool = saleOrdExt.UsrOverBool;
fscComDef.UsrOverAmt = saleOrdExt.UsrOverAmt;
fscComDef.UsrOverageCom = saleOrdExt.UsrOverageCom;
}
问题是RowSelecting事件处理程序在一个条件下工作,用户必须单击其中一个关联的字段,然后从所选行中显示记录。我是否通过PXDefault错误地定义了默认值?感谢您的任何意见,谢谢。
答案 0 :(得分:0)
Per Dmitry建议,在这个Base.Caches [typeof(UsrKSFSCCom)]中添加。在RowSelecting事件处理程序结束时更新(fscComDef)。