K Young
K Young

Reputation: 21

Acumatica - Problem with data displaying in custom field even though saved to database

I created a custom date field in the opportunity screen. The field shows up just as expected. I enter a date save the record, go out, go back in and the date is no longer there. However, when I query the database, the column is there and there is a data in the column. So, even though the date is being stored in the database it is not displaying it in the screen or when I added that value to the generic inquiry it is also blank. I am not a programmer but it seems like that should’ve been an easy thing to do. I found some references on the web of this type of problem but was hoping there was a more straightforward fix than what those appeared, as they were more programming than I am comfortable at this point.

I found many web pages explaining how to do this seemingly simple thing using the customization tools. Not sure what I'm missing.

I am running fairly recent version of 2019R1.

Any help would be appreciated!

Upvotes: 1

Views: 675

Answers (1)

K Young
K Young

Reputation: 21

Response from an Acumatica support person.. Evidently they changed some things with 2018R1. See comments/answers below from support. Image of the change I made in the customization tool is also below. After making this change the custom field worked as desired.


After reviewing it into more details, it sounds that it could be related to the new implementation of PXProjection on that DAC.

Unlike ver. 2017 R2, some DAC like the PX.Objects.CR.CROpportunity DAC were implemented as a regular Data Access Class:

[System.SerializableAttribute()]
[PXCacheName(Messages.Opportunity)]
[PXPrimaryGraph(typeof(OpportunityMaint))]
[CREmailContactsView(typeof(Select2<Contact,
    LeftJoin<BAccount, On<BAccount.bAccountID, Equal<Contact.bAccountID>>>,
    Where2<Where<Optional<CROpportunity.bAccountID>, IsNull, And<Contact.contactID, Equal<Optional<CROpportunity.contactID>>>>,
            Or2<Where<Optional<CROpportunity.bAccountID>, IsNotNull, And<Contact.bAccountID, Equal<Optional<CROpportunity.bAccountID>>>>,
            Or<Contact.contactType, Equal<ContactTypesAttribute.employee>>>>>))]
[PXEMailSource]//NOTE: for assignment map
public partial class CROpportunity : PX.Data.IBqlTable, IAssign, IPXSelectable
{
    ...
}

In version 2018 R1(and later) the PX.Objects.CR.CROpportunity DAC is a projection over the PX.Objects.CR.Standalone.CROpportunity and PX.Objects.CR.Standalone.CROpportunityRevision DACs:

[System.SerializableAttribute()]
[PXCacheName(Messages.Opportunity)]
[PXPrimaryGraph(typeof(OpportunityMaint))]
[CREmailContactsView(typeof(Select2<Contact,
    LeftJoin<BAccount, On<BAccount.bAccountID, Equal<Contact.bAccountID>>>,
    Where2<Where<Optional<CROpportunity.bAccountID>, IsNull, And<Contact.contactID, Equal<Optional<CROpportunity.contactID>>>>,
            Or2<Where<Optional<CROpportunity.bAccountID>, IsNotNull, And<Contact.bAccountID, Equal<Optional<CROpportunity.bAccountID>>>>,
            Or<Contact.contactType, Equal<ContactTypesAttribute.employee>>>>>))]
[PXEMailSource]//NOTE: for assignment map
[PXProjection(typeof(Select2<Standalone.CROpportunity,
    InnerJoin<Standalone.CROpportunityRevision,
        On<Standalone.CROpportunityRevision.opportunityID, Equal<Standalone.CROpportunity.opportunityID>,
        And<Standalone.CROpportunityRevision.revisionID, Equal<Standalone.CROpportunity.defRevisionID>>>>>), Persistent = true)]
public partial class CROpportunity : IBqlTable, IAssign, IPXSelectable
{
    ...
}

Because of that change, it's now required to declare 2 extension classes, one for Standalone.CROpportunity (normal DAC) and the CROpportunity  (PXProjection).

On the PXProjection DAC Extension, please remind to add BqlField to the correspondent field on the Standalone DAC, Ex.:  BqlField = typeof(CROpportunityStandaloneExt.usrTest)
public class CROpportunityExt : PXCacheExtension<PX.Objects.CR.CROpportunity> 
{
    #region UsrTest
    [PXDBDecimal(BqlField = typeof(CROpportunityStandaloneExt.usrTest))]
    [PXUIField(DisplayName="Test Field")]

    public virtual Decimal? UsrTest { get; set; }
    public abstract class usrTest : IBqlField { }
    #endregion
}

Please find more information on this article below:

Custom field on CROpportunity doesn't display saved value since upgrading from 6.10 or 2017R2 to 2018R1

change made in customization tool

Upvotes: 1

Related Questions