Answer the question
In order to leave comments, you need to log in
What can cause the number/code prefix to be duplicated?
Hello. There is a subscription to the event OnSettingNewCode() for all directories and OnSettingNewNumber() for all documents, the subscription is processed in the general module "ProcessingSubscriptions".
The prefix is taken from the constant PrefixIB (string, length 3). When setting prefixes, they will be duplicated to "BDBD". In the debugger at the time of setting the prefix: Префикс = ОбработкаПодписок.ПолучитьПрефиксИБ();
Here is all the necessary code:
&НаСервере
Функция ПолучитьПрефиксИБ() экспорт
Возврат Константы.ПрефиксИБ.Получить();
КонецФункции // ПолучитьПрефиксИБ()
Процедура ДобавлениеОбъектовСправочникиПриУстановкеНовогоКода(Источник, СтандартнаяОбработка, Префикс) Экспорт
Префикс = ОбработкаПодписок.ПолучитьПрефиксИБ();
КонецПроцедуры
Процедура ДобавлениеОбъектовДокументыПриУстановкеНовогоНомера(Источник, СтандартнаяОбработка, Префикс) Экспорт
Префикс = ОбработкаПодписок.ПолучитьПрефиксИБ();
КонецПроцедуры
Answer the question
In order to leave comments, you need to log in
The typical behavior of the system is to take the last number (no matter with which prefix) and increase the digital part by one. If you add a prefix on top of the result, then you will get duplication. Look at how it is done in the standard ones or organize a check yourself in the spirit: If Lion(Source.number, 2) <> Prefix Then ....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question