Skip to main content

I have a field in a custom DAC and I created a SQL constraint to ensure it is unique.

     FromCustomerID] Dint] NOT NULL UNIQUE,

Is there a way I can setup this DAC field to enforce this constraint so that it doesn’t require the DB to be hit prior to identifying the value entered in a grid is invalid?

This is my DAC field:

        #region FromCustomerID
        rCustomer(IsKey = true)]
        uPXUIField(DisplayName = "From Customer")]
        uPXRestrictor(typeof(Where<BAccount.parentBAccountID, IsNull>), ICSMessages.ChildAccount)]
        public virtual int? FromCustomerID { get; set; }
        public abstract class fromCustomerID : PX.Data.BQL.BqlInt.Field<fromCustomerID> { }
        #endregion

There is PXCheckUniqueAttribute that does that.

See here:

https://help-2022r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=2ed40453-9ee2-eaba-18f4-0df790282512


Thank you @Dmitrii Naumov .  I knew there had to be a way.  FYI, Looks like I am Semi-Pro I.  Someone needs to fix the algorithm.  There’s no way I am semi-pro…  HA!  😋


Reply