Community

Creating an instance of section using script

Good day,
My I have 2 Document definitions that should have 1 common export(xml) form. This documents can come both separately and together. So if they come together xml should look like this:
   <Document1>
      <Field1>123</Field1>
   </Document1>
   <Dcoument2>
      <Field1>123</Field2>    
   </Document2>

And if only Document1:
   <Document1>
      <Field1>123</Field1>
   </Document1>
   <Document2>
      </Field1> 
   </Document2>  

One possible solution is to make a set of Documents and it partly solves it, but if they come separately it looks like this:
   <Document1>
      <Field1>123</Field1>
   </Document1>

If there is something in settings that i can change I would appreciate you if you point on that, but i couldnt find it. 
I guess there is also possibility to create an empty instance of Document2. There is a method AddNew in
So i type Document.Section.AddNew(0), but nothing happens, how can i create an empty instance of Document 2?

0

Comments

0 comments

Please sign in to leave a comment.