I
I
Ilya Brazhnikov2017-04-14 18:23:56
1C
Ilya Brazhnikov, 2017-04-14 18:23:56

How to programmatically call the selection procedure from the directory in the usual form 1C 8.2?

I've already broken my head.
There is a document form, in it the field - DirectoryReference.Bolts
9a03abc2bf8c4dec933b5447651a2070.png
The task is to check whether the size of the bolt matches the size of the nut.
I made the procedure OnChange, but it works only once. If, after clicking No in the dialog and selecting the wrong bolt again, it ends up in the document without being checked.
4c75a86c8ccb477d9d538cdf71644245.png
I suspect that I am calling the selection box from the Bolts directory incorrectly. But I can't find a working solution. Or does it not exist at all?
Thank you in advance for your response.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kinash, 2017-04-14
@Ilyabr

1) Do not open the selection form programmatically, and after notifying the user about the error, offer to make this choice himself.
2) Open the form modally and get the result into a variable, which is immediately processed or thrown into the property of the object and call the same function (recursion).
3) Use the SelectHandling form handler, which is called after the select event in the subform (when getting your select form, you need to specify the current form as the owner).

K
Konstantin, 2017-04-14
@fosihas

More designs

Процедура ПолеВводаНачалоВыбора(Элемент, СтандартнаяОбработка) 
        // Запретить стандартную обработку. 
        СтандартнаяОбработка = Ложь; 
        // Получить форму выбора справочника как подчиненную полю ввода. 
        ФормаВыбора = Справочники.Номенклатура.ПолучитьФормуВыбора( , Элемент); 
        // Открыть полученную форму 
        ФормаВыбора.Открыть(); 
 
КонецПроцедуры

and passing a parameter
Форма = Отчеты.ОтчетДиаграмма.ПолучитьФорму("ФормаОсновная", ЭтаФорма); 
Форма.ПоложениеОкна = ВариантПоложенияОкна.НеПерекрыватьВладельца; 
Форма.Открыть();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question