I need to get some SOOrder extension values that I don’t have in my POReceipt. Is there a way to code this in C# in my POReceiptEntry graph extension?
POReceiptEntry graph extension: how do I get the SOOrder related to the POOrder?
Best answer by bpgraves
public PXSelectReadonly<POOrderReceipt, Where<POOrderReceipt.receiptNbr, Equal<Required<POOrderReceipt.receiptNbr>>>> KCPOOrderReceipt;
public PXSelectReadonly<POOrder, Where<POOrder.orderNbr, Equal<Required<POOrder.orderNbr>>>> KCPOOrder;
public PXSelectReadonly<PX.Objects.SO.SOOrder, Where<PX.Objects.SO.SOOrder.orderNbr, Equal<Required<PX.Objects.SO.SOOrder.orderNbr>>>> KCOrderByOrderNbr;
POReceipt receipt = Base.Document.Current;
POOrderReceipt poOrderReceipt = KCPOOrderReceipt.Select((object)receipt.ReceiptNbr);
if (poOrderReceipt != null && !string.IsNullOrEmpty(poOrderReceipt.PONbr))
{
POOrder poOrder = (POOrder)KCPOOrder.Select((object)poOrderReceipt.PONbr);
if (poOrder != null && poOrder.OrderType == "DP")
{
SOOrder order = this.KCOrderByOrderNbr.Select((object)poOrder.SOOrderNbr);
}
}
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.