E
E
ElizabethP2021-04-08 18:36:28
1C
ElizabethP, 2021-04-08 18:36:28

How to create an external processing that creates and post documents?

Good evening, I need an external processing that would create 50 RT&U documents and post them immediately. How can this be done syntactically? I know that there are a couple of lines, but I completely forgot how to do it right. I would be very grateful for your tips. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin Nagibovich, 2021-04-08
@nki

The document object has a Write(WriteMode, PostMode) method.
After creating the document and filling in its details, run this method with the required parameters.

K
Konstantin, 2021-04-08
@fosihas

i How to change the attribute value and save the document?

ДокОбъект = СсылкаНаДокумент.ПолучитьОбъект(); 
ДокОбъект.Ответственный = глТекущийПользователь; 
ДокОбъект.Записать(); 
 
ДокОбъект.Записать(РежимЗаписиДокумента.Проведение); 
 
ДокОбъект.Записать(РежимЗаписиДокумента.ОтменаПроведения);

S
Sgr_A, 2021-04-09
@Sgr_A

Для Счетчик = 1 По 50 Цикл
  
  НовыйДокументОбъект = Документы.РеализацияТоваровУслуг.СоздатьДокумент();
  
  //Заполнение документа
  НовыйДокументОбъект.Реквизит1 = "Значение1";
  НовыйДокументОбъект.Реквизит2 = "Значение2";
  //...
  НовыйДокументОбъект.РеквизитN = "ЗначениеN";
  
  Попытка
    НовыйДокументОбъект.Записать(РежимЗаписиДокумента.Проведение);
  Исключение
    ТекстОшибки = ОписаниеОшибки();
  КонецПопытки; 
  
КонецЦикла;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question