Answer the question
In order to leave comments, you need to log in
How in the form module to access the element located inside the object?
Hello, I have two directories: InformationAboutStudents and InformationAboutParents . The Student Information directory contains information about each student, including the address where he lives. The Parents Information directory contains data on the full name of the parents , their telephone number , address and the full name of their child .
And the task is this: so that in the form of creating a parent when choosing a child for him and clicking on the "Copy address" button, the child's residential address data, which is already filled in for him, would be copied into the "Address" field for the parent, because, as a rule, parents and their children live at the same address.
To implement the task, I created a form
And wrote the following code:
&НаКлиенте
Процедура КопироватьАдрес(Команда)
Объект.Адрес = Объект.Ребенок.Адрес;
КонецПроцедуры
&НаКлиенте
Процедура КопироватьАдрес(Команда)
Объект.Адрес = Объект.Ребенок.УникальныйИдентификатор();
КонецПроцедуры
Answer the question
In order to leave comments, you need to log in
The ability to access properties of a reference type through a dot does not work on the
client . Those. you will not be able to find out on the client the values of the properties of the object referenced by Object.Child . You can read the properties of the Object itself , because it is a structure, but the Child is already a reference to the reference book. You need to make a server call for this. The easiest way:
&НаКлиенте
Процедура КопироватьАдрес(Команда)
Объект.Адрес = УзнатьАдрес(Объект.Ребенок);
КонецПроцедуры
&НаСервере
Функция УзнатьАдрес(Ребенок)
Возврат Ребенок.Адрес;
КонецФункции
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question