Z
Z
Zh Zh2018-04-04 09:46:52
1C
Zh Zh, 2018-04-04 09:46:52

How was the previous date and the changed date automatically inserted in 1C?

Tell me , please, where is the error:
ChangeShippingDate = FormElements.Software Orders.CurrentData.ShippingDate;
If FormerTO <> ModShipDate THEN
ModShipDate = FormItems.OrdersPO.CurrentData.ShipDate;
Record =RegisterInformation.Problems.CreateRecordSet();
Record.Selection.RFQ.Set(FormElements.Software Orders.CurrentData.RFQ.Link);
Record.Selection.Period.Set(FormerBEFORE);
Tab = Record.Add();
Tab.FormerDO = FormerDO;
Tab.ChangedShippingDate = ChangedShippingDate;
Tab. Period \u003d Previous TO;
Tab.ZP = FormElements.OrdersSoftware.CurrentData.ZP.Link;
Record.GetForm("ListForm").Open();
EndIf;
The essence of the question is that when the form is opened, the values ​​\u200b\u200bof the changed date and the previous date are automatically inserted. Only a form opens without values
. I have 1C SCP edition 1.3.
FormerTO, ChangeDateShipment - variables.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kinash, 2018-04-04
@elKam

Please tell me where is the mistake

There are no errors.
You get a list form for the information register and, without filling it with any values, immediately open it. In the recordset, which is the main attribute of the form, it is not a fact that the selected selection from your set will be copied, but the records will not be transferred just by magic.
You need to first get the form, then fill it with data and only then open it. The code below is just as a guide. Suppose that on your form the main attribute is named ProblemSet:
ФормаПроблем = РегистрСведений.Проблемы.ПолучитьФорму("ФормаСписка");

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

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

ФормаПроблем.Открыть();

Plus a note on the code.
1) Form Elements.Software Orders.CurrentData.RF.Reference is the equivalent of the shorter record FormElements.Software Orders.CurrentData.RF, but only to get a Link from a CR (Link type) you load the entire order document from the database into memory (an extra request to the database, loss of time and RAM).
2) If Software Orders is not a PM or TK, but a dynamic list based on the Software Orders document, or an element of the DocumentList. Software Orders type, then you can write even simpler: Form Elements. Software Orders. Current Line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question