Implement Numbering Sequence for Customized Field

In this article, I would like to cover how to add a numbering sequence to the customized field in the custom screens.

Numbering Sequences are useful to generate a unique number or ID each time a user creates a document. I have created a new customized screen i.e. Deck Setup with DeckNbr as a auto-numbering field. Please find the details below.


[PXCacheName("Deck Setup")]
    public class KNDeckSetup : IBqlTable
        #region DeckNbr
        [PXDBString(15, IsKey = true, IsUnicode = true, InputMask = "")]
        [PXUIField(DisplayName = "Deck ID", Visibility = PXUIVisibility.SelectorVisible)]
        [PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
        [PXSelector(typeof(KNDeckSetup.deckNbr), typeof(KNDeckSetup.deckNbr))]
        [AutoNumber(typeof(KNSOSetupExt.usrDeckNumberingID), typeof(KNDeckSetup.createdDateTime))]

        public virtual string DeckNbr { get; set; }
        public abstract class deckNbr : BqlString.Field<deckNbr> { }

      // Remaining DAC fields Deck Name, Username, and Password and etc.,

Deck Setup Graph Code

public class DeckSetup : PXGraph<DeckSetup>
        #region View
        public PXSelect<KNDeckSetup> KNDeckSetup;
        public PXSave<KNDeckSetup> Save;
        public PXCancel<KNDeckSetup> Cancel;

        public PXAction<KNDeckSetup> TestConnection;
        [PXUIField(DisplayName = "TEST CONNECTION", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Enabled = false)]
        protected virtual IEnumerable testConnection(PXAdapter adapter)
            // logic here
            return adapter.Get();

Sales Order Preference screen customization

Introduced a new custom field i.e., Deck Numbering Sequence in the Sales Order Preferences screen. The numbering sequence is to be used to assign IDs to Deck when a new Deck is created by using the Deck Setup screen.

public class KNSOSetupExt : PXCacheExtension<SOSetup>
        #region UsrDeckNumberingID
        [PXDBString(15, IsUnicode = true, InputMask = "")]
        [PXUIField(DisplayName = "Deck Numbering Sequence", Required = true)]
        [PXSelector(typeof(Numbering.numberingID), DescriptionField = typeof(Numbering.descr))]
        public virtual string UsrDeckNumberingID { get; set; }
        public abstract class usrDeckNumberingID : BqlString.Field<usrDeckNumberingID> { }


Leave a Reply

Your email address will not be published. Required fields are marked *