Skip to main content
Answer

Populate a grid column when a grid selection column value is selected

  • August 2, 2024
  • 2 replies
  • 60 views

Forum|alt.badge.img

I’m working on a modification on Payment Screen (AR302000) “DOCUMENT TO APPLY” grid. I need to to populate data into a another call when user selects Reference Nbr. What should be the best event to handle here?

Please refer the image below:

Thank you

Best answer by DipakNilkanth

Hi @oshadhat83,

To handle the event when a user selects a Reference Nbr in the "DOCUMENT TO APPLY" grid on the Payments and Applications Screen (AR302000), the best approach is to use the FieldUpdated event for the appropriate field. In this case, you would typically handle the event for the ARAdjust.AdjdRefNbr field, which corresponds to the reference number of the document being applied.

public class ARPaymentEntry_Extension : PXGraphExtension<ARPaymentEntry>
{
protected void ARAdjust_AdjdRefNbr_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
var row = (ARAdjust)e.Row;
if (row == null) return;

//logic to retrieve the field you needed.
}
}

Hope, it helps!

2 replies

DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi @oshadhat83,

To handle the event when a user selects a Reference Nbr in the "DOCUMENT TO APPLY" grid on the Payments and Applications Screen (AR302000), the best approach is to use the FieldUpdated event for the appropriate field. In this case, you would typically handle the event for the ARAdjust.AdjdRefNbr field, which corresponds to the reference number of the document being applied.

public class ARPaymentEntry_Extension : PXGraphExtension<ARPaymentEntry>
{
protected void ARAdjust_AdjdRefNbr_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
var row = (ARAdjust)e.Row;
if (row == null) return;

//logic to retrieve the field you needed.
}
}

Hope, it helps!


darylbowman
Captain II
Forum|alt.badge.img+15

A defaulting event for the custom field and calling e.Cache.SetDefaultExt in the FieldUpdated event for Ref Nbr would work well.

I prefer this because if the defaulting logic isn't terribly complicated, all of this can be controlled with DAC attributes with

[PXDefault]

and

[PXFormula(typeof(Default<>))]