Hi, there are a few options for defining the format of a lot number but I need to try and extend the options. The screen shot below shows a date based setup. This leads to a lot number like 2408
In the INLotSerClass table on the database you can see the format, which is : {0:yy}{0:dd}
I want to add a new option called DayOfYear, there are a few challenges to getting this into the UI but if this worked I might end up with a format like {0:yy}{0:w} and this would provide a lot number like 24221
w isn’t a valid datetime formatting string so I would need to adjust the Acumatica code.
In the Acumatica source code in class Attribute.cs I can see that GetNextNumber is how the format is translated into a value to create a lot number. The code is below.
public static string GetNextNumber(PXCache sender, INLotSerClass lsClass, ILotSerNumVal lotSerNum)
{
string numval = new string('0', GetNumberLength(lotSerNum));
return string.Format(lsClass.LotSerFormatStr, sender.Graph.Accessinfo.BusinessDate, numval).ToUpper();
}
However, because it is a static method I don’t think I can override it. Is this correct?
Is there a way to replace it with my own method?
As anyone else tried to add new options to provide more flexible lot number creation?
Thank you