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, I use the POReceiptLine DAC but I don't know why I am having the error Invalid Object Name POReceiptLineS everytime I want to Enter AP Bill. It seems POReceiptLineS is a DAC but I don't see where I need to reference it.
public class APInvoiceEntry_Extension : PXGraphExtension<PX.Objects.AP.APInvoiceEntry>
{
[PXProjection(typeof(Select<POReceiptLineAdd>))]
public partial class POReceiptLineAddOverride : POReceiptLineAdd
{
#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;
}
}
}
}
Best answer by Zoltan Febert
View original