Solved

Add column to Selector Reference Nbr doesn't work in 23R1

  • 23 January 2024
  • 11 replies
  • 91 views

Userlevel 3
Badge

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?

 

icon

Best answer by Zoltan Febert 28 February 2024, 01:04

View original

11 replies

Userlevel 6
Badge +3

Hi @mrthanhkhoi,

Have you tried to reset selector columns?

 

Userlevel 3
Badge

 hello @Zoltan Febert

Reset selector columns didn’t work

 

Userlevel 6
Badge +3

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

Userlevel 3
Badge

@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
}
}

 

Userlevel 6
Badge +3

@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)]

 

Userlevel 3
Badge

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.

Userlevel 6
Badge +3

Hi @mrthanhkhoi,

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

Userlevel 3
Badge

@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
Userlevel 6
Badge +3

@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.

Userlevel 3
Badge

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

 

 

 

Userlevel 6
Badge +3

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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved