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.