M
M
mrgrigo2018-09-25 11:31:18
1C
mrgrigo, 2018-09-25 11:31:18

Why are programmatically created directory entries not deleted?

Hello. There is some code:

&НаКлиенте
Процедура Старт(Команда)
    
    НачатьГенерацию(Наименование, Количество);
    
КонецПроцедуры

&НаСервере
Процедура НачатьГенерацию(п_Наименование, п_Количество)

    Если ЗначениеЗаполнено(п_Наименование) И ЗначениеЗаполнено(п_Количество) Тогда
        
        л_Старт = 1;
    	Пока л_Старт <= п_Количество Цикл
        
        	л_Элемент = Справочники.Номенклатура.СоздатьЭлемент();
            л_Элемент.Наименование = п_Наименование + л_Старт;
            л_Элемент.Записать();
            л_Старт = л_Старт + 1;
        
        КонецЦикла;
        
    Иначе
        
        Сообщить("Нужно заполнить все поля");
        
    КонецЕсли; 	

КонецПроцедуры

Elements created in this way can be marked for deletion, but cannot be interactively deleted, and the system "does not see" their mark for deletion when deleting the marked ones.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kinash, 2018-09-25
@Dementor

There is some code:
Just creating items in the Nomenclature reference book - the details are not important.
Elements created in this way can be marked for deletion, but cannot be interactively deleted.
Not enough rights. Practically in all typical ones, interactive deletion of elements in preset roles is prohibited.
the system "does not see" their mark for deletion when deleting marked
If the standard procedure from the "Operations" / "All functions" menu does not see them, then there really was no mark. If you have a separate processing, then they did not fall under some kind of filter - sort it out.

V
Vadim Popov, 2018-09-25
@vadimpopov94

It would be more logical to attach, in addition, the code with which you are trying to delete the elements of the directory (if you do it programmatically, of course).
If you use the standard functionality for deleting marked ones, and you don’t see these elements there, try using the query console, for example, and select these elements of the directory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question