Skip to main content
Solved

Grab info from line level to header

  • Jan 20, 2022 1:55 AM UTC
  • 3 replies
  • 354 views
  • Translate All

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();
}
}

 

 

View original

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Answer
  • Jan 20, 2022 3:19 AM UTC

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();
}
}

 

 

Translate

Forum|alt.badge.img
  • Author
  • Varsity I
  • Jan 26, 2022 8:07 AM UTC

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

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jan 26, 2022 9:04 AM UTC

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

Translate