Skip to main content
Answer

How can I add Alternate ID in SO303000 (Invoice) in detail grid

  • June 30, 2025
  • 5 replies
  • 96 views

FinnSystemAG
Freshman II
Forum|alt.badge.img

Hello,

I would like to know how I can display the Alternate ID in the Invoice detail grid.

Could you please guide me on how to achieve this?

Best answer by svwk05

@FinnSystemAG 

If you want to display the Alternate ID in the Invoice Detail grid:

First, create a custom field in the DAC (e.g., UsrAlternateID). Then, use the FieldSelecting event in the graph to fetch and assign the corresponding Alternate ID for the selected Inventory Item.

This will allow the value to be shown dynamically in the UI. Below is the sample code.

In DAC

#region UsrAlternateID
[PXString(30, IsUnicode = true)]
[PXUIField(DisplayName = "Alternate ID", Enabled = false)]
public virtual string UsrAlternateID { get; set; }
public abstract class usrAlternateID : PX.Data.BQL.BqlString.Field<usrAlternateID> { }
#endregion

In GraphExtension 

protected void ARTran_UsrAlternateID_FieldSelecting(PXCache sender, PXFieldSelectingEventArgs e)
{
var row = (ARTran)e.Row;
if (row?.InventoryID == null || Base.Document.Current?.CustomerID == null)
return;

var altID = PXSelectJoin<INItemXRef,
InnerJoin<InventoryItem, On<INItemXRef.inventoryID, Equal<InventoryItem.inventoryID>>>,
Where<INItemXRef.inventoryID, Equal<Required<INItemXRef.inventoryID>>,
And<INItemXRef.bAccountID, Equal<Required<INItemXRef.bAccountID>>>>>
.Select(Base, row.InventoryID, Base.Document.Current.CustomerID)
.RowCast<INItemXRef>()
.FirstOrDefault();

if (altID != null)
{
e.ReturnValue = altID.AlternateID;
}
}


Hope this helps!

5 replies

Forum|alt.badge.img+1
  • Semi-Pro III
  • Answer
  • June 30, 2025

@FinnSystemAG 

If you want to display the Alternate ID in the Invoice Detail grid:

First, create a custom field in the DAC (e.g., UsrAlternateID). Then, use the FieldSelecting event in the graph to fetch and assign the corresponding Alternate ID for the selected Inventory Item.

This will allow the value to be shown dynamically in the UI. Below is the sample code.

In DAC

#region UsrAlternateID
[PXString(30, IsUnicode = true)]
[PXUIField(DisplayName = "Alternate ID", Enabled = false)]
public virtual string UsrAlternateID { get; set; }
public abstract class usrAlternateID : PX.Data.BQL.BqlString.Field<usrAlternateID> { }
#endregion

In GraphExtension 

protected void ARTran_UsrAlternateID_FieldSelecting(PXCache sender, PXFieldSelectingEventArgs e)
{
var row = (ARTran)e.Row;
if (row?.InventoryID == null || Base.Document.Current?.CustomerID == null)
return;

var altID = PXSelectJoin<INItemXRef,
InnerJoin<InventoryItem, On<INItemXRef.inventoryID, Equal<InventoryItem.inventoryID>>>,
Where<INItemXRef.inventoryID, Equal<Required<INItemXRef.inventoryID>>,
And<INItemXRef.bAccountID, Equal<Required<INItemXRef.bAccountID>>>>>
.Select(Base, row.InventoryID, Base.Document.Current.CustomerID)
.RowCast<INItemXRef>()
.FirstOrDefault();

if (altID != null)
{
e.ReturnValue = altID.AlternateID;
}
}


Hope this helps!


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

The Graph Extension in SOInvoiceEntry ?


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

Yes SOInvoiceEntry

 


mohammadnawaz51
Jr Varsity I
Forum|alt.badge.img+4

@FinnSystemAG 

Please review the instruction in below article.

 


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

Thanks Saikrishna