Skip to main content
Solved

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

  • June 30, 2025
  • 5 replies
  • 172 views
  • Translate All

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 Saikrishna V

​@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!

View original

5 replies

Forum|alt.badge.img+4

​@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!

Translate

FinnSystemAG
Freshman II
Forum|alt.badge.img

The Graph Extension in SOInvoiceEntry ?

Translate

Forum|alt.badge.img+4

Yes SOInvoiceEntry

 

Translate

mohammadnawaz51
Varsity I
Forum|alt.badge.img+8

​@FinnSystemAG 

Please review the instruction in below article.

 

Translate

FinnSystemAG
Freshman II
Forum|alt.badge.img

Thanks Saikrishna

Translate