I'm having an issue on the SOInvoiceEntry.cs when I create a new invoice or prepare an invoice from the SOOrderEntry->Shipment->Invoice the invoiceNbr is not being entered until the user clicks another field associated to that DAC
before pressing a field associated with the DAC
After pressing a field with associated with the DAC
I created a new DAC called UsrKSFSCCom
It has one isKey field among the many on the dac
[PXDBString(50, IsKey = true, IsUnicode = true, InputMask = "")]
[PXDBDefault(typeof(ARInvoice.refNbr))]
[PXUIField(DisplayName = "InvoiceNbr")]
public string UsrInvoiceNbr { get; set; }
public class usrInvoiceNbr : IBqlField{}
I have a ARInvoice_Rowselecting event handler set up as follows
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;
}
The issue is the RowSelecting Event handler works on one condition, the user must click one of the fields associated then the records appear from the row selected. Am I incorrectly defining the default value through PXDefault? Any input is appreciated, thank you.