4

Does anybody knows how to use PXAttributeExtension in Acumatica?

Can I use it for modification of existing attributes, for example CurrencyInfoAttribute?

Yuriy Zaletskyy
  • 4,983
  • 5
  • 34
  • 54

1 Answers1

1

PX.Data.PXAttributeExtension has been removed as of version 5.1

Fortunately Acumatica provides a variety of ways to both override and modify existing attributes within the system, the mostly commonly used one are :

[PXMergeAttributes] - Placed on a CacheAttached handler, reuses existing attributes defined in DAC

[PXMergeAttributes(Method = MergeMethod.Merge)]
[NPSubaccount(typeof(APTranExtension.usrNPFundID), typeof(APTranExtension.usrNPMasterID), typeof(APTran.accountID), typeof(APTran.branchID), true)]
protected virtual void APTran_SubID_CacheAttached(PXCache sender)
{
}

[PXCustomizeBaseAttributeAttribute] - Placed on a CacheAttached handler, Overrides a single property on a attribute for a particular screen

[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXCustomizeBaseAttribute(typeof(PXUIFieldAttribute), nameof(PXUIFieldAttribute.DisplayName), "Refined Subaccount")]
protected virtual void APTran_SubID_CacheAttached(PXCache sender)
{
}

A great article on the methods of overriding and customizing attributes can be found here : https://www.codeday.top/2017/10/10/47532.html

Joshua Van Hoesen
  • 1,684
  • 15
  • 30