Skip to main content
Answer

How can I add LotSerialNbr from SOShipline (SO302000) in SO303000 (Invoice) in detail grid

  • July 1, 2025
  • 4 replies
  • 77 views

FinnSystemAG
Freshman II
Forum|alt.badge.img

Hello,

how can I add LotSerialNbr from SOShipline (SO302000) in SO303000 (Invoice) in detail grid ?

 

Thanks in advance

Best answer by darylbowman

If you want the ARTran to lookup the current value of the SOShipLine (every time), you can place this on a custom unbound field in ARTran:

[PXDBScalar(typeof(SearchFor<SOShipLine.lotSerialNbr>.
In<
SelectFrom<SOShipLine>.
Where<SOShipLine.shipmentType.IsEqual<ARTran.sOShipmentType>.
And<SOShipLine.shipmentNbr.IsEqual<ARTran.sOShipmentNbr>>.
And<SOShipLine.lineNbr.IsEqual<ARTran.sOShipmentLineNbr>>>>))]

If you want to copy the value (once) from SOShipLine, this might help you. As I recall, the same method gets executed regardless of it the invoice is created ‘from’ ‘Sales Orders’ or ‘Shipments’.

4 replies

Forum|alt.badge.img+1
  • Semi-Pro III
  • July 1, 2025

@FinnSystemAG 

The article below should help you with your requirement.

 


FinnSystemAG
Freshman II
Forum|alt.badge.img
  • Author
  • Freshman II
  • July 1, 2025

I did my best to get it right with the help of the article, but I failed.

 


darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • July 1, 2025

If you want the ARTran to lookup the current value of the SOShipLine (every time), you can place this on a custom unbound field in ARTran:

[PXDBScalar(typeof(SearchFor<SOShipLine.lotSerialNbr>.
In<
SelectFrom<SOShipLine>.
Where<SOShipLine.shipmentType.IsEqual<ARTran.sOShipmentType>.
And<SOShipLine.shipmentNbr.IsEqual<ARTran.sOShipmentNbr>>.
And<SOShipLine.lineNbr.IsEqual<ARTran.sOShipmentLineNbr>>>>))]

If you want to copy the value (once) from SOShipLine, this might help you. As I recall, the same method gets executed regardless of it the invoice is created ‘from’ ‘Sales Orders’ or ‘Shipments’.


Forum|alt.badge.img+1
  • Semi-Pro III
  • July 1, 2025

@FinnSystemAG 

Here is the sample code

[PXString(100, IsUnicode = true)]
[PXUIField(DisplayName = "Lot/Serial Nbr", Enabled = false)]
[PXDBScalar(typeof(
Search<SOShipLineSplit.lotSerialNbr,
Where<SOShipLine.shipmentType.IsEqual<ARTran.sOShipmentType>.
And<SOShipLine.shipmentNbr.IsEqual<ARTran.sOShipmentNbr>>.
And<SOShipLine.lineNbr.IsEqual<ARTran.sOShipmentLineNbr>>>>))]
public virtual string UsrLotSerialNbr { get; set; }
public abstract class usrLotSerialNbr : PX.Data.BQL.BqlString.Field<usrLotSerialNbr> { }

Hope this helps