Skip to main content
Solved

How to get custom field value from Payment and Application screen to Bank Deposit screen document level

  • October 8, 2021
  • 1 reply
  • 246 views

Hi Everyone ,

We have  below requirement , can anyone suggest best possible way to achieve it please?

  • Added a new field in Payment and Application header level

     

  • Should display the above custom field value in Bank Deposit Document level grid


    Thanks in advance.

Best answer by Naveen Boga

Hi @lakshmim85,

You can have logic at persist delegate() at cache inserted block to fetch custom field and assign it to Grid field. Please find the sample code below for your reference.

 public class CADepositEntryExtension : PXGraphExtension<CADepositEntry>
{
public delegate void PersistDelegate();
[PXOverride]
public void Persist(Action del)
{
if (Base.Document.Cache.GetStatus((object)Base.Document.Current) == PXEntryStatus.Inserted)
{

foreach(var paymentrecord in Base.DepositPayments.Select())
{
// Write a logic to fetch the custom field value based on the Payment Type and Reference Nbr and assign it to grid field.

}

}
del();
}
}

 

1 reply

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • October 8, 2021

Hi @lakshmim85,

You can have logic at persist delegate() at cache inserted block to fetch custom field and assign it to Grid field. Please find the sample code below for your reference.

 public class CADepositEntryExtension : PXGraphExtension<CADepositEntry>
{
public delegate void PersistDelegate();
[PXOverride]
public void Persist(Action del)
{
if (Base.Document.Cache.GetStatus((object)Base.Document.Current) == PXEntryStatus.Inserted)
{

foreach(var paymentrecord in Base.DepositPayments.Select())
{
// Write a logic to fetch the custom field value based on the Payment Type and Reference Nbr and assign it to grid field.

}

}
del();
}
}