The document contains details "Contact Person" and "Phone". It is necessary that when the contact person is changed, the phone is automatically inserted. The user chooses data from the directory "Contact Persons of Counterparties". I am writing a code, but nothing happens when I select a contact person in the field with the phone. Please help me:

&НаКлиенте Процедура КонтактноеЛицоПриИзменении(Элемент) КонтактноеЛицо = Объект.КонтактноеЛицо; Объект.Телефон = ПолучитьТел (КонтактноеЛицо); КонецПроцедуры &НаСервереБезКонтекста Функция ПолучитьТел (КонтактноеЛицо) Возврат КонтактноеЛицо.ОсновнойТел; КонецФункции 
  • Unfortunately, there is no platform at hand to demonstrate how this should work. You are obviously doing something wrong. Excuse me, but it seems to me that stackflowflow is not the best place to get information on programming in 1C. Did not try to look here: mista.ru/tutor_1c/index.htm or here: forum.mista.ru/index.php . There are more willing to answer and people in the subject at times more. In addition, there is Radchenko's remarkable manual "1C: Enterprise: A Practical Developer's Guide. Examples and Typical Techniques." There such things are disassembled in sufficient detail. - Sublihim
  • @Sublihim good, thanks, take a look. Yes, I noticed that I was doing something wrong, because it does not work :)))) - Elena
  • yes not even in some kind of slightly conceptual sense) - Sublihim
  • @Sublihim Understood, thanks, on this site suggested where you gave the link. It turns out the code is correct, the error was in the type of the field "telephone". This should be a number, and I have a reference element - Elena
  • well, that's good :) - Sublihim

0