Good day,
I have 2 custom fields on the purchase receipt line and in Bills and adjustment line, I want those fields in the Dialog of the ADD PO RECEIPT LINE button in the Bills and adjustment screen, retrieve the information and apply it on the Bills and adjustment line.
I can release the purchase receipt, but I can't get the data in the Bills and adjustment.
I have a projection override and my events in a graph extension of the Bills and adjustment screen, to retrieve the information, when my DAC override inherits from POReceiptLineAdd I am having the error Invalid Object Name POReceiptLineS everytime I want to Enter AP Bill. POReceiptLineAdd inherits from POReceiptLineS and when my DAC inherits from it the warning error disappears but the ADD PO RECEIPT LINE button does nothing.
public class APInvoiceEntry_Extension : PXGraphExtension<PX.Objects.AP.APInvoiceEntry>
{
PXProjection(typeof(Select<POReceiptLineAdd>))]
public partial class POReceiptLineAddOverride : POReceiptLineS
{
#region UsrTicketSupplier
PXDBString(255)]
PXUIField(DisplayName = "Ticket Supplier", Enabled = true)]
public string UsrTicketSupplier { get; set; }
public abstract class usrTicketSupplier : PX.Data.BQL.BqlString.Field<usrTicketSupplier> { }
#endregion
#region UsrTicketCarrier
PXDBString(255)]
PXUIField(DisplayName = "Ticket Carrier", Enabled = true)]
public string UsrTicketCarrier { get; set; }
public abstract class usrTicketCarrier : PX.Data.BQL.BqlString.Field<usrTicketCarrier> { }
#endregion
}
public PXSelect<POReceiptLineAddOverride> POReceiptcheck;
public override void Initialize()
{
base.Initialize();
Base.Views.Caches.Remove(typeof(POReceiptLineAdd));
Base.Views.Caches.Add(typeof(POReceiptLineAddOverride));
}
protected virtual void _(Events.RowSelected<POReceiptLineAddOverride> e)
{
if (e.Row == null) return;
POReceiptLineAddOverride row = e.Row;
POReceiptLine receiptLine = PXSelect<POReceiptLine,
Where<POReceiptLine.receiptNbr, Equal<Required<POReceiptLine.receiptNbr>>,
And<POReceiptLine.lineNbr, Equal<Required<POReceiptLine.lineNbr>>>>>
.Select(Base, row.ReceiptNbr, row.LineNbr);
if (receiptLine != null)
{
row.UsrTicketSupplier = receiptLine.GetExtension<POReceiptLineExt>().UsrTicketSupplier;
row.UsrTicketCarrier = receiptLine.GetExtension<POReceiptLineExt>().UsrTicketCarrier;
}
}
protected virtual void _(Events.RowPersisting<APTran> e)
{
if (e.Row == null) return;
APTran row = e.Row;
if (row.ReceiptNbr != null && row.ReceiptLineNbr != null)
{
POReceiptLineAddOverride receiptLine = PXSelect<POReceiptLineAddOverride,
Where<POReceiptLineAddOverride.receiptNbr, Equal<Required<POReceiptLineAddOverride.receiptNbr>>,
And<POReceiptLineAddOverride.lineNbr, Equal<Required<POReceiptLineAddOverride.lineNbr>>>>>
.Select(Base, row.ReceiptNbr, row.ReceiptLineNbr);
if (receiptLine != null)
{
row.GetExtension<APTranExt>().UsrTicketSupplier = receiptLine.UsrTicketSupplier;
row.GetExtension<APTranExt>().UsrTicketCarrier = receiptLine.UsrTicketCarrier;
}
}
}
}