Skip to main content
Answer

Grab info from line level to header

  • January 20, 2022
  • 3 replies
  • 295 views

Forum|alt.badge.img

Hi there,

 

I have a fairly simple requirement in which the first row of the line level will overwrite the info in header level (both are custom fields). Example of it is shown in the screenshot below:

 

I have read a similar case to this but from header to row: Getting value of field on header from grid change event, however I failed to grasp on how to narrow it down to only the first line.

Best answer by Naveen Boga

Hi @ericklasimin61 

Here is the simple source code to achieve the requirement. Also, attached video recording for your reference.

  public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
public delegate void PersistDelegate();
[PXOverride]
public void Persist(PersistDelegate del)
{
if (Base.Document.Current != null)
{
SOLine objSOLine = Base.Transactions.Select().FirstTableItems.ToList().FirstOrDefault(); // To get the First Row from Document Details tab
Base.Document.Current.OrderDesc = objSOLine.TranDesc;
}

del();
}
}

 

 

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • January 20, 2022

Hi @ericklasimin61 

Here is the simple source code to achieve the requirement. Also, attached video recording for your reference.

  public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
public delegate void PersistDelegate();
[PXOverride]
public void Persist(PersistDelegate del)
{
if (Base.Document.Current != null)
{
SOLine objSOLine = Base.Transactions.Select().FirstTableItems.ToList().FirstOrDefault(); // To get the First Row from Document Details tab
Base.Document.Current.OrderDesc = objSOLine.TranDesc;
}

del();
}
}

 

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • January 26, 2022

You’re a wizard, @Naveen B ! It works like a charm! Thanks a lot!


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • January 26, 2022

Awesome @ericklasimin61  Thanks a lot for sharing the update. :-)