How to automatically clone or duplicate all data from a subform to another | Community
Skip to main content
September 27, 2022
Question

How to automatically clone or duplicate all data from a subform to another

  • September 27, 2022
  • 2 replies
  • 1717 views

We are trying to create a form that will contain 3 subform where the third one most be an exact copy of the first one. 

 

The first subform is bind to a table where only 10 lines can be print on this one because of its size.

If more than 10 lines exists, it will be printed to the next page.

The second subform contains fixed values.

The third subform most be identical to the first one.

 

Furthermore, if the first subform need overflow, it should be printed to a second page with the same layout of the first page. So the third subform of the second page must be an exact copy of the first subform of that second page too Etc.

 

This is not an interactive form, so no button will be available. It must be fully automatic.

 

Any idea how to perform this?

 

I am new in Adobe and newer in Javascript.

 

A solution I though was to create a new table where this one will contain duplicated record of the original table and use that one to bind to the first subform and have the overflow to the third subform.

But I don't know how to code that in Javascript.

 

All suggestions will be highly appreciated.

Regard

stjacqd 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

radzmar
September 27, 2022

The simplest way is to set all fields in those subforms to a global binding and use the same namings for fields, that should show the same data.

stjacqdAuthor
September 27, 2022

Hello Radzmar

 

Thank you for your reply.

 

What is a global binding? For now, the table in subform "Row1" of SUB_A is binded to the context table element and each cells are binded to a field of that table.

 

How the table and cells of the subform "SUB_C" should be dinded?

 

The answer of my question can be obvious but what is a global binding?

 

Regards

 

Because when I am binding the table1 and cells of the "SUB_C" to the same context table of table1 of "SUB_A". It doesn't work.

 

radzmar
September 27, 2022

Every field and subform has a binding property which can be set under the binding tab of the object pallette.It can be none, name, global or a reference to a data node defined by a XML scheme (XSD).

 

 

The binding tells the PDF viewer how to handle the entered data. Fields with the same name and a global bindung will always hold the same values.

Mayank_Gandhi
Adobe Employee
Adobe Employee
September 29, 2022

@stjacqd The field are identified by it's object name, similar to html "id". Now there are two ways to achieve this.

  1. Write a script on each field and set the other field with the same value on exit event. You can loop through a panel since the table looks the same and just set it using a script.
  2. Create schema(XSD) map two the table which needs to have the same value to same attribute(schema need to have rows as repeatable else you will get issues)
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:element name="Search">
        <xs:complexType>
            <xs:sequence>
              <xs:element name="Term" minOccurs="1" maxOccurs="1" type="xs:string" />
                <xs:sequence minOccurs="0" maxOccurs="unbounded">
                  <xs:element name="And" type="xs:string" />
                  <xs:element name="Term" type="xs:string" />
                </xs:sequence>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>


 

In the end what's less time taking and easy to scale choose that.

https://help.adobe.com/en_US/AEMForms/6.1/DesignerQuickStartTutorials/WS92d06802c76abadb6fe0558212a19a83673-7fe0.2.html

 

https://help.adobe.com/en_US/AEMForms/6.1/DesignerQuickStartTutorials/WS92d06802c76abadb6fe0558212a19a83673-7fe0.2.html