The 1C:Enterprise developers forum
Hello.I have a document table. It has sub tables in it. I can add rows to the document table with code. How can I add a record to a subtable?
RowMaster= Documents.MasterDocumentTable.FindByAttribute("Col1", "ABC"); RowMasterRef = RowMaster.Ref.GetObject(); SubNewRecord = RowMaster.DetailTable1.Add(); ?? ... ...
Hello. I am writing the solution to the problem.
RowMaster= Documents.MasterDocumentTable.FindByAttribute("Col1", "ABC"); RowMasterRef = RowMaster.Ref.GetObject(); SubNewRecord = RowMasterRef.DetailTable1.Add(); SubNewRecord.Col1 = "A"; SubNewRecord.Col2 = "B"; RowMasterRef.Write(DocumentWriteMode.Posting);
Hello Erdoğan,could you show a screenshot from the Designer with the structure of this document?
Hello.I changed the design. My first model was useless. Inadequate in query usage. That's why I split the tables. But the code I wrote is correct.