Skip to main content
Answer

The fields are cleared

  • October 22, 2025
  • 3 replies
  • 51 views

Forum|alt.badge.img+1

I have dac:
 

using PX.Data;
using System;
using PX.Data.BQL.Fluent;
using PX.Objects.GL;
using static PX.Objects.AP.APTran;

namespace ASAmazonIntegration.Ext
{
    [PXCacheName(Messages.SPAmazonTransactionMapping)]
    public class SPAmazonTransactionMapping : PXBqlTable, IBqlTable
    {
        #region BindingID
        [PXDBInt(IsKey = true)]
        [PXDBDefault(typeof(SPAmazonStore.bindingID))]
        [PXParent(typeof(SelectFrom<SPAmazonStore>.
            Where<SPAmazonStore.bindingID.
                IsEqual<SPAmazonTransactionMapping.bindingID.FromCurrent>>))]
        public virtual int? BindingID { get; set; }
        public abstract class bindingID : PX.Data.BQL.BqlInt.Field<bindingID> { }
        #endregion

        #region TranType
        public abstract class tranType : PX.Data.BQL.BqlString.Field<tranType> { }
        [PXDBString(15, IsUnicode = true, IsKey = true)]
        [PXUIField(DisplayName = Messages.TranType)]
        [PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
        [SPAmazonTranTypeAttribute]
        public virtual String TranType { get; set; }
        #endregion

        #region TranDesc
        public abstract class tranDesc : PX.Data.BQL.BqlString.Field<tranDesc> { }
        [PXDBString(256, IsUnicode = true)]
        [PXUIField(DisplayName = Messages.TransactionDescription, Visibility = PXUIVisibility.Visible)]
        public virtual String TranDesc { get; set; }
        #endregion

        #region AccountID
        public abstract class accountID : PX.Data.BQL.BqlInt.Field<accountID> { }
        [PXDBInt]
        [PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
        public virtual Int32? AccountID { get; set; }
        #endregion

        #region SubID
        public abstract class subID : PX.Data.BQL.BqlInt.Field<subID> { }
        [PXDBInt]
        [PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
        public virtual Int32? SubID { get; set; }
        #endregion

        #region System Fields
        #region CreatedDateTime
        [PXDBCreatedDateTime()]
        public virtual DateTime? CreatedDateTime { get; set; }
        public abstract class createdDateTime : PX.Data.BQL.BqlDateTime.Field<createdDateTime> { }
        #endregion

        #region CreatedByID
        [PXDBCreatedByID()]
        public virtual Guid? CreatedByID { get; set; }
        public abstract class createdByID : PX.Data.BQL.BqlGuid.Field<createdByID> { }
        #endregion

        #region CreatedByScreenID
        [PXDBCreatedByScreenID()]
        public virtual string CreatedByScreenID { get; set; }
        public abstract class createdByScreenID : PX.Data.BQL.BqlString.Field<createdByScreenID> { }
        #endregion

        #region LastModifiedDateTime
        [PXDBLastModifiedDateTime()]
        [PXUIField(DisplayName = Messages.LastModifiedDate, Enabled = false)]
        public virtual DateTime? LastModifiedDateTime { get; set; }
        public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
        #endregion

        #region LastModifiedByID
        [PXDBLastModifiedByID()]
        public virtual Guid? LastModifiedByID { get; set; }
        public abstract class lastModifiedByID : PX.Data.BQL.BqlGuid.Field<lastModifiedByID> { }
        #endregion

        #region LastModifiedByScreenID
        [PXDBLastModifiedByScreenID()]
        public virtual string LastModifiedByScreenID { get; set; }
        public abstract class lastModifiedByScreenID : PX.Data.BQL.BqlString.Field<lastModifiedByScreenID> { }
        #endregion

        #region Tstamp
        [PXDBTimestamp()]
        public virtual byte[] Tstamp { get; set; }
        public abstract class tstamp : PX.Data.BQL.BqlByteArray.Field<tstamp> { }
        #endregion

        #region NoteID
        [PXNote()]
        public virtual Guid? NoteID { get; set; }
        public abstract class noteID : PX.Data.BQL.BqlGuid.Field<noteID> { }
        #endregion
        #endregion
    }
}
When I edit row in grid. Other field when i saved changes cleared. Why?

In graph, I don't have anything.

This is table in MSsql:
 

 

Best answer by darylbowman

Your database type for ‘TranType’ is char. I believe char is a fixed-length type.

You should either add ‘IsFixed = true’ (and probably remove ‘IsUnicode=true’) in the ‘TranType’ PXDBString attribute OR change the database type to nvarchar.

I’m not certain this is your problem, but as it’s part of the key, it seems possible that it could be.

3 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • October 22, 2025

@bihalivan15 Do you have the view of type Select or PXFilter in your graph? 

I guess it’s the latter but it needs to be the former


Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • October 22, 2025

@bihalivan15 Do you have the view of type Select or PXFilter in your graph? 

I guess it’s the latter but it needs to be the former

public SelectFrom<SPAmazonTransactionMapping>
           .Where<SPAmazonTransactionMapping.bindingID
               .IsEqual<SPAmazonStore.bindingID.FromCurrent>>
           .OrderBy<Asc<SPAmazonTransactionMapping.tranType>>
           .View TransactionMapping;
I have this in graph


darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • October 22, 2025

Your database type for ‘TranType’ is char. I believe char is a fixed-length type.

You should either add ‘IsFixed = true’ (and probably remove ‘IsUnicode=true’) in the ‘TranType’ PXDBString attribute OR change the database type to nvarchar.

I’m not certain this is your problem, but as it’s part of the key, it seems possible that it could be.