Skip to main content

Hello everyone,

I want to add a custom field to selector AdjdRefNbr on screen Check and Payment (AP302000)

 

I use following code PXCustomizeSelectorColumns to add new field (usrInvoiceText) to selector, it works for 22R2 but doesn’t work for 23R1

public class AP_APAdjust_ExistingColumn : PXCacheExtension<APAdjust>
{
#region AdjdRefNbr
>PXMergeAttributes(Method = MergeMethod.Replace)]
>PXCustomizeSelectorColumns(
typeof(APAdjust.APInvoice.refNbr),
typeof(APRegisterExt.usrInvoiceText),
typeof(APAdjust.APInvoice.docDate),
typeof(APAdjust.APInvoice.finPeriodID),
typeof(APRegister.vendorLocationID),
typeof(Standalone.APRegister.curyID),
typeof(APRegister.curyOrigDocAmt),
typeof(APRegister.curyDocBal),
typeof(Standalone.APRegister.status),
typeof(APAdjust.APInvoice.dueDate),
typeof(APAdjust.APInvoice.invoiceNbr),
typeof(Standalone.APRegister.docDesc),
typeof(APInvoice.dueDate))]
public string AdjdRefNbr { get; set; }
#endregion
}

 

Do you have any idea why it doesn’t work anymore?

 

Hi @mrthanhkhoi,

Have you tried to reset selector columns?

 


 hello @Zoltan Febert

Reset selector columns didn’t work

 


@mrthanhkhoi Can you show me your field declaration in your DAC?


@Zoltan Febert 

DAC Custom field:

using PX.Data;
using System;

namespace PX.Objects.AP
{
public class APRegisterExt : PXCacheExtension<APRegister>
{
#region UsrInvoiceText
PXDBString(20)]
PXUIField(DisplayName = "Invoice Note")]

public virtual string UsrInvoiceText{ get; set; }
public abstract class usrInvoiceText: PX.Data.BQL.BqlString.Field<usrInvoiceText> { }
#endregion
}
}

 

add this field to selector by using PXCustomizeSelectorColumns

using PX.Data;

namespace PX.Objects.AP
{
PXNonInstantiatedExtension]
public class AP_APAdjust_ExistingColumn : PXCacheExtension<APAdjust>
{
#region AdjdRefNbr
PXMergeAttributes(Method = MergeMethod.Replace)]
PXCustomizeSelectorColumns(
typeof(APAdjust.APInvoice.refNbr),
typeof(APRegisterExt.usrInvoiceText),
typeof(APAdjust.APInvoice.docDate),
typeof(APAdjust.APInvoice.finPeriodID),
typeof(APRegister.vendorLocationID),
typeof(Standalone.APRegister.curyID),
typeof(APRegister.curyOrigDocAmt),
typeof(APRegister.curyDocBal),
typeof(Standalone.APRegister.status),
typeof(APAdjust.APInvoice.dueDate),
typeof(APAdjust.APInvoice.invoiceNbr),
typeof(Standalone.APRegister.docDesc))]
public string AdjdRefNbr { get; set; }
#endregion
}
}

 


@mrthanhkhoi 

I tried your code I got an error when opened the selector. After I modified PXMergeAttribute, it started working and I see the Invoice Note field.

>PXMergeAttributes(Method = MergeMethod.Merge)]

 


hello @Zoltan Febert, thank you for your testing.

I tried with the same but it doesn’t work on my side. Which version Acumatica are you using?

I am using 23R1.

The code works in 22R2 but after upgrading to 23R1 it doesn’t work anymore.


Hi @mrthanhkhoi,

I tried it on 23R108. Can you upload your customization package here?


@Zoltan Febert , please find the customization package in attachment. I also attach the source code project.

  • Customization package: APCheckPayment.zip
  • Code project: APCheckPayment_SrcCode.zip

@mrthanhkhoi

I published your package and it worked as expected. Something is wrong with your instance.

You can try to unpublish all customizations, and only publish this one. Or try to deploy another instance to see how it works on it.


hello @Zoltan Febert

For your information, I create new instance and import package that I sent to you but it doesn’t work.

I am using version 23.105.0016

I guess the reason could come from how the system is configured so I attach the configuration of my instance. Hope this will help

 

 

 


Hi @mrthanhkhoi,

Maybe it is to late, and you have already figured it out, but I also found the solution.

The trick is APPaymentEntryJointCheck also modifies the selector, so you need to extend that graph extension, it is not enough to modify it in the DAC.

using PX.Data;
using PX.Objects.AP;

namespace PX.Objects.AP
{
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class TestAPPaymentEntryExt : PXGraphExtension<PX.Objects.CN.JointChecks.APPaymentEntryJointCheck, APPaymentEntry>
{
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXCustomizeSelectorColumns(
typeof(APAdjust.APInvoice.refNbr),
typeof(APRegisterExt.usrInvoiceText),
typeof(APAdjust.APInvoice.docDate),
typeof(APAdjust.APInvoice.finPeriodID),
typeof(APRegister.vendorLocationID),
typeof(Standalone.APRegister.curyID),
typeof(APRegister.curyOrigDocAmt),
typeof(APRegister.curyDocBal),
typeof(Standalone.APRegister.status),
typeof(APAdjust.APInvoice.dueDate),
typeof(APAdjust.APInvoice.invoiceNbr),
typeof(Standalone.APRegister.docDesc))]
[PXUIField(DisplayName = "Retek")]
protected virtual void APAdjust_AdjdRefNbr_CacheAttached(PXCache sender)
{

}
}
}

 


Reply