I Create a new screen called material request note. I need to add a numbering sequence to its ref Number field.
Firstly’ a numbering sequence was created as bellow.
Then add a field to Inventory preferences and set its value to required numbering sequence ID
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class INSetupExt : PXCacheExtension<PX.Objects.IN.INSetup>
{
#region UsrCustomField
[PXDBString(15, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Material Request Note Num Sequence", Required = true)]
[PXSelector(typeof(Numbering.numberingID), DescriptionField = typeof(Numbering.descr))]
public virtual string UsrMaterialRequestRefNbr{ get; set; }
public abstract class usrMaterialRequestRefNbr: PX.Data.BQL.BqlString.Field<usrMaterialRequestRefNbr> { }
#endregion
}
Finally, modify the RefNbr field in the DAC as bellow.
public class MRMaterialRequest : IBqlTable
{
#region RefNbr
[PXDBString(15, IsKey = true, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Ref Nbr", Visibility = PXUIVisibility.SelectorVisible)]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
[PXSelector(typeof(MRMaterialRequest.refNbr),typeof(MRMaterialRequest.refNbr))]
[AutoNumber(typeof(INSetupExt.usrMaterialRequestRefNbr), typeof(MRMaterialRequest.createdDateTime))]
public virtual string RefNbr { get; set; }
public abstract class refNbr : PX.Data.BQL.BqlString.Field<refNbr> { }
#endregion
//.... res of fields
}
But when trying to save a material request it gives CS Error: Cannot generate the next number for the sequence.
And in my numbering sequence, I had added <NEW> as the new number symbol. But in the material request screen new number symbol displays as <SELECT>, I'm unable to understand how it happens
when doing this I referred to following article.