S
S
Sergey2020-10-23 10:35:23
1C
Sergey, 2020-10-23 10:35:23

How to access the directory from the document form?

I'm writing a config from scratch. I decided to transfer a bunch of excel files to 1C.
When filling out the document, the cell of the NormExpenseDt column should pull up the value from the References.Car Brand (each brand has 4 attributes NormExpenseCitySummer, NormExpenseCityWinter, NormExpenseForCitySummer, NormExpenseForCityWinter) and give them in the form of a drop-down list to the user when filling out the line. But no matter how hard I try to access the Directory from the Document Form, I get an error.

Auto Document: Document Form
&НаКлиенте
Процедура ТабличнаяЧасть1ПриИзменении(Элемент)
Авто = Элементы.Автомобиль.ТекстРедактирования; //Получаю название Автомобиля
СпрАвто = Справочники.Автомобиль.ПолучитьДанныеВыбора(Авто); //Получаю Марку автомобиля
СпрМарка = Справочники.МаркаАвтомобиля.ПолучитьДанныеВыбора(СпрАвто);    //Получаю значения реквизитов НормаРасходДт
Стр.НормаРасходаДт = Справочники.СпрМарка; //Передаю их в ячейку (Выпадающий список) на форме
КонецПроцедуры

Screenshot

5f928634e53ac856528829.jpeg

Screenshot 2

5f92934ca239b415657554.jpeg


Ps: Do not scold too much, 2nd day at 1C.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2020-10-23
@SuNbka

So far, it has been possible to automatically display the filled data in the document header, but it is not possible to drag the values ​​into the drop-down list inside the document table.

Screenshot 1
5f92b65096d2f763625046.jpeg

Screenshot 2
5f92b65823835335624936.jpeg

M
Matvey Seregin, 2020-10-24
@MaestroOlmer

1. If, depending on certain conditions, the selection list should be different, then try for the form element corresponding to the column of the tabular section, to define the SelectFromListStart event, in which to fill in the selection list for the element. You can also use the select from list property.
2. If it does not depend on changing conditions, then the selection list for an element can be set programmatically when creating a form on the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question