Answer the question
In order to leave comments, you need to log in
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
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.
i How to change the attribute value and save the document?
ДокОбъект = СсылкаНаДокумент.ПолучитьОбъект();
ДокОбъект.Ответственный = глТекущийПользователь;
ДокОбъект.Записать();
ДокОбъект.Записать(РежимЗаписиДокумента.Проведение);
ДокОбъект.Записать(РежимЗаписиДокумента.ОтменаПроведения);
Для Счетчик = 1 По 50 Цикл
НовыйДокументОбъект = Документы.РеализацияТоваровУслуг.СоздатьДокумент();
//Заполнение документа
НовыйДокументОбъект.Реквизит1 = "Значение1";
НовыйДокументОбъект.Реквизит2 = "Значение2";
//...
НовыйДокументОбъект.РеквизитN = "ЗначениеN";
Попытка
НовыйДокументОбъект.Записать(РежимЗаписиДокумента.Проведение);
Исключение
ТекстОшибки = ОписаниеОшибки();
КонецПопытки;
КонецЦикла;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question