If you ever get the error “DictType object not initialized” when working with number sequences you probably have a faulty reference to a datatype. This can easily be solved by going to the NumberSequenceDatatype table and delete the record for the incorrect reference.
If you do not know which one just add an info with
info(strFmt(“%1 – %2”, this.DatatypeId, extendedTypeId2name(this.DatatypeId)))
in the method
and you will see which one it is when you try to add a reference to a number sequence.
There is a good post regarding this @ https://community.dynamics.com/ax/f/33/t/171486
The structure of how number sequences are built is stored in a hidden field so when exporting you may get what the number sequence looks like but not hoe it is built an thus it will fail when trying to change it or possibly even when calling it.
You can solve this by using a formula with annoted format.
Each segment is built with
- digit (0 Company / -1 Constant / -2 Numeric)
- Value (“Text”/ #####)
If you want to add another segment you add
- Next segment just like stated above
So a formula might look like this: =-1&CHAR(09)&”Invoice_”&CHAR(10)&-2&CHAR(09)&####
resulting in something like “Invoice_1224”