Skip to main content

I am attempting to setup autonumbering on a key field by hardcoding the sequence ID in a constant. When the form displays, it is just showing SELECT in the field.

Here is the DAC code:

       public class ProjectOrderNumbering : PX.Data.BQL.BqlString.Constant<ProjectOrderNumbering>
       {
           public ProjectOrderNumbering() : base("TESTPROJECTS") { }  // "TESTPROJECTS" is the sequence ID
       }

       #region ProjectID
        PXDBString(15, IsKey = true, IsUnicode = true)]
       iPXUIField(DisplayName = "Project ID")]
       ePXDefault]
       ÂAutoNumber(typeof(ProjectOrderNumbering), typeof(AccessInfo.businessDate))]
       //cPXSelector(typeof(S1CProject.projectID), typeof(AccessInfo.businessDate))]

 

Is it possible to use constants for the sequence id, or does it have to go through a setup screen as shown in T220?

 

Hi @mpierson  Instead hard coding you can take a custom field and generate the auto number like below. Hope this helps

https://asiablog.acumatica.com/2022/02/implement-numbering-sequence-for-customized-field.html 


Hi @mpierson 

 

The T220 course details how to set up auto numbering.

The logic can be applied to custom or new fields.

 

Aleks


hi @mpierson 

 

Apologies I misread your question.

Yes, all numberings have to be setup through the numbering sequence as shown in the T220 course and controlled in the preferences form.

 

Although adding a field to that form is all it will take to get it to work.

 

Aleks


Hi @mpierson 

 

If for some reason you should have hardcoded value in your code or you shouldn’t create field on a setup form you can try to create PXDimensionSelector.

Example you can find in PMProject DAC.

This approach requires to create Segment Key with one segment where you can specify Numbering Sequence.
 


Reply