M
M
mrgrigo2018-10-12 11:51:52
1C
mrgrigo, 2018-10-12 11:51:52

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

1 answer(s)
D
Dmitry Kinash, 2018-10-12
@Dementor

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 question

Ask a Question

731 491 924 answers to any question