palikarp2014-03-13 21:02:48
palikarp, 2014-03-13 21:02:48

1C 8.2 - how to programmatically load data values ​​from the directory into the field of the list of data values?

Good afternoon, tell me, please, an amateur, there is an arbitrary form on it field: SelectCity (List of values) field type: Directory.Link.Classifier
how to load data from the directory into a drop-down list?
Procedure OnOpen()

Запрос = Новый Запрос;
Запрос.Текст = "Выбрать Город Из Справочник.Классификатор";
Список = Новый СписокЗначений;
ЭтаФорма.ЭлементыФормы.ВыбратьГород.СписокВыбора = Список;

does not work.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
thepry, 2014-03-14

Your code does not fill in the field itself, but fills in a selection list - a list of values ​​from which the user will be able to choose if the selection mode from the list is set.
By the phrase "does not work" it is not possible to understand what the problem is: is it impossible to fill in the selection list, or is it impossible to choose from it?
In the first case, the select list needs to be filled in, not replaced with your list of values.
Something like this:
ChoiceArray = Query.Execute().Upload().UnloadColumn("City");

Vitaly, 2014-06-04

Look in the form field event helper syntax AtStartSelection and AtStartSelectionFromList (depends on field properties). And then StandardProcessing=false; and fill in the selection data. Do you have managed forms at all? If so, then it is better not to write queries in the context of the client

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question