Skip to main content
Answer

Linking SOShipment and Invoice Screens for Custom Field Transfer

  • June 12, 2025
  • 3 replies
  • 74 views

Forum|alt.badge.img

Hello everyone,
I want to customize the ship date by adding a new field from the SOShipment and transfer its content to the Invoice.

Does anyone know how I can link the SOShipment and Invoice screens to include this field from the Shipment note in the invoice?

I tried to connect the screens using this formula.

 


 

Best regards,

Pantea
 

Best answer by harutyungevorgyan

Hello ​@PanteaShahrian ,

Your formula is attempting to look up SOShipment records on the ARRegister DAC by using ARTran fields. You can’t use an ARTran field to find SOShipment on the ARRegister.

  • Show Lieferdatum per line:
    As one invoice can have multiple Shipments, I would suggest displaying “Lieferdatum” for each shipment line. Simply move your field with the PXFormula into the ARTran DAC so it evaluates on every transaction, and it will work.
  • Single-shipment invoices only:
    If you know—either for your process or your client’s—that each invoice will always have exactly one shipment, add a ShipmentNbr field to the ARRegister (invoice header). During the document’s Persist, check if that field is still null and, if so, populate it with the first shipment number retrieved from your Transactions (ARTran) view; this way, you will be sure that the logic will work only once after the first Shipment line added. After the header’s ShipmentNbr is set, your existing PXFormula on ARRegister will reliably return the correct shipment date; you just need to change it a little bit like this :[PXFormula(typeof(Selector<ARRegisterExt.usrSOShipmentNbr, SOShipment.shipDate>))]

3 replies

harutyungevorgyan
Jr Varsity I
Forum|alt.badge.img+2

Hello ​@PanteaShahrian ,

Your formula is attempting to look up SOShipment records on the ARRegister DAC by using ARTran fields. You can’t use an ARTran field to find SOShipment on the ARRegister.

  • Show Lieferdatum per line:
    As one invoice can have multiple Shipments, I would suggest displaying “Lieferdatum” for each shipment line. Simply move your field with the PXFormula into the ARTran DAC so it evaluates on every transaction, and it will work.
  • Single-shipment invoices only:
    If you know—either for your process or your client’s—that each invoice will always have exactly one shipment, add a ShipmentNbr field to the ARRegister (invoice header). During the document’s Persist, check if that field is still null and, if so, populate it with the first shipment number retrieved from your Transactions (ARTran) view; this way, you will be sure that the logic will work only once after the first Shipment line added. After the header’s ShipmentNbr is set, your existing PXFormula on ARRegister will reliably return the correct shipment date; you just need to change it a little bit like this :[PXFormula(typeof(Selector<ARRegisterExt.usrSOShipmentNbr, SOShipment.shipDate>))]

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • June 16, 2025

@harutyungevorgyan Thank You 🙂


FinnSystemAG
Freshman II
Forum|alt.badge.img
  • Freshman II
  • June 24, 2025

Hello ​@PanteaShahrian ,

Your formula is attempting to look up SOShipment records on the ARRegister DAC by using ARTran fields. You can’t use an ARTran field to find SOShipment on the ARRegister.

  • Show Lieferdatum per line:
    As one invoice can have multiple Shipments, I would suggest displaying “Lieferdatum” for each shipment line. Simply move your field with the PXFormula into the ARTran DAC so it evaluates on every transaction, and it will work.

 

its not working

[PXDBDate]
        [PXUIField(DisplayName = "Lieferdatum")]
        [PXFormula(typeof(Selector<ARTran.sOShipmentNbr, PX.Objects.SO.SOShipment.shipDate>))]

 

Lieferdatum is still empty

 

Hope u can help