Solved

Modification of a standard field changes it to a virtual field

  • 25 February 2024
  • 1 reply
  • 35 views

Good day everyone, 

We have a changed the description field of the OwnerID (standard field) and changed the description field to use our usrCustomName field like this:
 

[PXNonInstantiatedExtension]
public class CR_CROpportunity_ExistingColumn : PXCacheExtension<PX.Objects.CR.CROpportunity>
{
#region OwnerID
[PXDBInt]
[PXMergeAttributes(Method = MergeMethod.Append)]
[PXCustomizeBaseAttribute(typeof(OwnerAttribute), "DescriptionField",
typeof(MAKLBAccountExt.usrCustomName))]
[PXSelector(typeof(Search<EPEmployee.defContactID>),
typeof(EPEmployee.acctCD),
typeof(EPEmployee.acctName),
typeof(BAccountExt.usrCustomName))]
public int? OwnerID { get; set; }
#endregion
}

The changes we made is on the CROpportunityExt DAC.

The problem we face now however is that we get an error on the Generic Inquiries

and the DAC Schema also displays this:

 

 

If I unpublish this, it works. 

Has any one ever experienced this and if so, how did you get around this? Is there something I did wrong in the code? 

 

Thanks in advance. 

icon

Best answer by darylbowman 26 February 2024, 15:26

View original

1 reply

Badge +11

There are a couple things I would try:

  1. You have the merge method specified as MergeMethod.Append, but you are redefining the selector, which I believe you’d want to replace. I would try MergeMethod.Merge
  2. You’re redefining [PXDBInt], which may be required, since it’s originally rolled into the [Owner] attribute, but you are going to need to define the BQL field that this field is attached to, because CROpportunity is a projection

I would try something like this:

#region OwnerID  
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXCustomizeBaseAttribute(typeof(OwnerAttribute), "DescriptionField",
typeof(MAKLBAccountExt.usrCustomName))]
[PXDBInt(BqlField = typeof(Standalone.CROpportunityRevision.ownerID))]
[PXSelector(typeof(Search<EPEmployee.defContactID>),
typeof(EPEmployee.acctCD),
typeof(EPEmployee.acctName),
typeof(BAccountExt.usrCustomName))]
public int? OwnerID { get; set; }
#endregion

 

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