Hello,
Not a C# developer, and very new to acumatica.
Using the below code I was able to figure out how to add the CustomerOrderNbr and ShipmentNbr to the package ex custom reference nbr 1 & 2. The label is generated using the UPS Rest carrier.
My issue is the the very lengthy prefix as seen in my attached image. How do I remove the custom reference prefixes “Reference No.1” and “Reference No.2”
Also below is my code. Please let me know if I need to add anything like cache updating. Currently the code works but other examples included some cache update code I did not understand.
protected void SOPackageDetailEx_RowPersisting(PXCache cache, PXRowPersistingEventArgs e, PXRowPersisting InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (SOPackageDetailEx)e.Row;
SOOrderShipment shipment = PXSelect<SOOrderShipment, Where<SOOrderShipment.shipmentNbr, Equal<Required<SOPackageDetailEx.shipmentNbr>>>>.Select(Base, row.ShipmentNbr);
if (shipment == null) return;
SOOrder order = PXSelect<SOOrder, Where<SOOrder.orderNbr, Equal<Required<SOOrderShipment.orderNbr>>>>.Select(Base, shipment.OrderNbr);
if (order == null) return;
row.CustomRefNbr1 = "Purchase No.:" + order.CustomerOrderNbr;
row.CustomRefNbr2 = "Invoice No.:" + row.ShipmentNbr;
}