Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Subject: Sub-sub-subform with multiple iterations at ea level

Avatar

Former Community Member

I am building a form with 3 levels of subforms.  At each level, there can be multiple iterations of the item.
The only way I can get it to work is by editing the xml data file so that every field in each iteration
has a placeholder (ex.  <capacityField type="String" />), even when its a null field.

In the past, if a field was null, it would format correctly, even if there was no field identifier (or "placeholder")
for the field.

Is there a fix for this?  Or is this something that the schema needs to be setup to control?  If it is a schema
setup issue, how does it need to be set up?

Schema Illustration:

Party(items)
      CompanyName
      CompanyAddress
      Contact(items)
            Name
            Address
            Code
            Statement(items)
                       FirstCountField
                       CapacityField
                       ConsolidateField
                       Frequency(Items)
                             FreqName
   
Sample Data:

ABC International Company Party1
      ABC Chicago Party1 Company
      1414 State Street
      Chicago IL
      Code 40
       Postal Statement1
                 4
                 15 Max
                 16161616534 ABC Consolidated Acct
                       Monthly Freq1
                       Bi-weekly Freq2

XYZ Telecom Company Party2
      14 San Francisco Party2 Company
      1414 Bay Street
      San Fran CA
      Code 30
       Wire Statement1
            2
            100 Max
            1234123434 XYZ Consolidated Acct
                  Daily Freq1
                  Weekly Freq2
       Postal Statement2
            7
            52 Max
            987987987 XYZ Consolidated Acct
                  Daily Freq1
                  Weekly Freq2
                  Monthly Freq3
 

2 Replies

Avatar

Level 8

What exactly does the raw XML look like?

Kyle

Avatar

Former Community Member

I've pasted the section of the xml data file for the section.  On line 94 there is no placeholder for capacityCode. A placeholder there would look like this:  <capacityCode type="String"/>

On line 105 for example, you can see that iteration of statement has a value for the field capacityCode:

<capacityCode type="String"><![CDATA[0 C2_S2_Regular mailing]]></capacityCode>

What happens, is that if the xml data file omits the placeholder for the field capacityCode in the first iteration of a statement, like it did on line 94, then when the form is rendered (previewed), the field for capacityCode in the first statement pulls the capacityCode value from the second iteration of statement.  All the statements following will incorrectly have the capacityCode value from the next statement iteration.

Here is the xml data file section:

   <partyStatements type="CT_PartyStatement[]">
      <item>
        <status type="String"><![CDATA[Complete]]></status>
        <isExistingCustomer type="Boolean"><![CDATA[false]]></isExistingCustomer>
        <partyName type="String"><![CDATA[Partyname 1]]></partyName>
        <partyType type="String"><![CDATA[Individual]]></partyType>
        <contacts type="CT_Contact[]">
          <item>
            <id type="String"><![CDATA[CONTACT1-CDATA[1389034412]]></id>
            <status type="String"><![CDATA[Complete]]></status>
            <name type="String"><![CDATA[CONTACT1]]></name>
            <title type="String"><![CDATA[Mr]]></title>
            <email type="String"><![CDATA[asdf]]></email>
            <dob type="Date"><![CDATA[2014/01/01 00:00:00.0 CST]]></dob>
            <isSetup type="Boolean"><![CDATA[false]]></isSetup>
            <identifier type="String"><![CDATA[1231231234]]></identifier>
            <isSetupNeeded type="Boolean"><![CDATA[false]]></isetupNeeded>
            <statement type="CT_AdviceStatement">
    <isRequireStatements type="Boolean"><![CDATA[true]]></isRequireStatements>
    <statements type="CT_Statement[]">
     <item>
      <format type="String"><![CDATA[C1S1-CDATA[PJ/PJ SD POST-PRICE TAX LOT CHRONO]]></format>
      <formatOther type="String" />
      <frequency type="String[]">
     <item><![CDATA[C1_S1_F1_Annual]]></item>
     <item><![CDATA[C1_S1_F2_Semi-Annual]]></item>
     <item><![CDATA[C1_S1_F3_Quarterly]]></item>
      </frequency>
      <firstCycle type="String"><![CDATA[C1S1-January]]></firstCycle>
      <capacityCode type="String"><![CDATA[0 C1S1-Regular mailing]]></capacityCode>
      <numOfCopies type="Integer"><![CDATA[1]]></numOfCopies>
      <optionalCategoryChanges type="String" />
     </item>
    </statements>
    <advices type="CT_Advice">
      <isRequireProxyReceipt type="Boolean"><![CDATA[false]]></isRequireProxyReceipt>
      <isReceiveFeeInvoices type="Boolean"><![CDATA[true]]></isReceiveFeeInvoices>
      <isRequireDuplicateFeeInvoices type="Boolean"><![CDATA[true]]></isRequireDuplicateFeeInvoices>
    </advices>
            </statement>
            <FFFC type="CT_FFFC">
              <status type="String"><![CDATA[In Progress]]></status>
              <ofacDocumentName type="String" />
            </ofac>
            <address type="Address">
              <address1 type="String"><![CDATA[asdf]]></address1>
              <address2 type="String" />
              <address3 type="String" />
              <address4 type="String" />
              <address5 type="String" />
              <city type="String"><![CDATA[asdf]]></city>
              <state type="String"><![CDATA[Alabama : AL : 2]]></state>
              <country type="String"><![CDATA[US]]></country>
              <postalCode type="String"><![CDATA[55555]]></postalCode>
            </address>
            <phoneNumbers type="Phone[]">
              <item>
                <type type="String"><![CDATA[Work]]></type>
                <number type="String"><![CDATA[1231231234]]></number>
              </item>
            </phoneNumbers>
            <te type="CT_Mentials" />
          </item>
        </contacts>
        <isThisStatementParty type="Boolean"><![CDATA[true]]></isThisStatementParty>
      </item>
      <item>
        <status type="String"><![CDATA[Complete]]></status>
        <isExistingCustomer type="Boolean"><![CDATA[false]]></isExistingCustomer>
        <partyName type="String"><![CDATA[PartyName 2]]></partyName>
        <partyType type="String"><![CDATA[Individual]]></partyType>
        <contacts type="CT_Contact[]">
          <item>
            <id type="String"><![CDATA[C2 -CDATA[1389034412]]></id>
            <status type="String"><![CDATA[Complete]]></status>
            <name type="String"><![CDATA[C2]]></name>
            <title type="String"><![CDATA[Mr]]></title>
            <email type="String"><![CDATA[asdf]]></email>
            <dob type="Date"><![CDATA[2014/01/01 00:00:00.0 CST]]></dob>
            <isSetup type="Boolean"><![CDATA[false]]></isSetup>
            <identifier type="String"><![CDATA[1231231234]]></identifier>
            <isSetupNeeded type="Boolean"><![CDATA[false]]></isSetupNeeded>
            <statement type="CT_AdviceStatement">
    <isRequireStatements type="Boolean"><![CDATA[true]]></isRequireStatements>
    <statements type="CT_Statement[]">
     <item>
      <format type="String"><![CDATA[C2 S1-CDATA[PJ/PJ SD POST-PRICE TAX LOT CHRONO]]></format>
      <formatOther type="String" />
      <frequency type="String[]">
     <item><![CDATA[C2_S1_F1_Annual]]></item>
     <item><![CDATA[C2_S1_F2_Quarterly]]></item>
      </frequency>
      <firstCycle type="String"><![CDATA[C2_S1_December]]></firstCycle>
      <numOfCopies type="Integer"><![CDATA[3]]></numOfCopies>
      <optionalCategoryChanges type="String" />
      <consolidatedAccountNumber type="String">C2_S1_123123456789</consolidatedAccountNumber>
     </item>
     <item>
      <format type="String"><![CDATA[C2 S2-CDATA[PD/PD SD PRE-PRICE CHRONO]]></format>
      <formatOther type="String" />
      <frequency type="String[]">
     <item><![CDATA[C2_S2_F1_Monthly]]></item>
      </frequency>
      <firstCycle type="String"><![CDATA[C2_S2_January]]></firstCycle>
      <capacityCode type="String"><![CDATA[0 C2_S2_Regular mailing]]></capacityCode>
      <numOfCopies type="Integer"><![CDATA[1]]></numOfCopies>
      <optionalCategoryChanges type="String" />
     <consolidatedAccountNumber type="String">C2_S2_123123456789</consolidatedAccountNumber>
     </item>
     <item>
      <format type="String"><![CDATA[C2 S3-CDATA[PD/PD SD PRE-PRICE CHRONO]]></format>
      <formatOther type="String" />
      <frequency type="String[]">
     <item><![CDATA[C2_S3_F1_Quarterly]]></item>
     <item><![CDATA[C2_S3_F2_Full Moons]]></item>
      </frequency>
      <firstCycle type="String"><![CDATA[C2_S3_March]]></firstCycle>
      <capacityCode type="String"><![CDATA[0 C2_S3_mailing]]></capacityCode>
      <numOfCopies type="Integer"><![CDATA[1]]></numOfCopies>
      <optionalCategoryChanges type="String" />
     <consolidatedAccountNumber type="String">C2_S3_123123456789</consolidatedAccountNumber>
     </item>

     </statements>
    <advices type="CT_Advice">
      <isRequireProxyReceipt type="Boolean"><![CDATA[false]]></isRequireProxyReceipt>
      <isReceiveFeeInvoices type="Boolean"><![CDATA[true]]></isReceiveFeeInvoices>
      <isRequireDuplicateFeeInvoices type="Boolean"><![CDATA[true]]></isRequireDuplicateFeeInvoices>
    </advices>
            </statement>
            <FFAC type="CT_FFAC">
              <status type="String"><![CDATA[In Progress]]></status>
              <ofacDocumentName type="String" />
            </ofac>
            <address type="Address">
              <address1 type="String"><![CDATA[asdf]]></address1>
              <address2 type="String" />
              <address3 type="String" />
              <address4 type="String" />
              <address5 type="String" />
              <city type="String"><![CDATA[asdf]]></city>
              <state type="String"><![CDATA[Alabama : AL : 2]]></state>
              <country type="String"><![CDATA[US]]></country>
              <postalCode type="String"><![CDATA[55555]]></postalCode>
            </address>
            <phoneNumbers type="Phone[]">
              <item>
                <type type="String"><![CDATA[Work]]></type>
                <number type="String"><![CDATA[1231231234]]></number>
              </item>
            </phoneNumbers>
            <t type="CTMentials" />
          </item>
          <item>
            <id type="String"><![CDATA[C3-389034412]]></id>
            <status type="String"><![CDATA[Complete]]></status>
            <name type="String"><![CDATA[C3]]></name>
            <title type="String"><![CDATA[Mr]]></title>
            <email type="String"><![CDATA[asdf]]></email>
            <dob type="Date"><![CDATA[2014/01/01 00:00:00.0 CST]]></dob>
            <isSetup type="Boolean"><![CDATA[false]]></isSetup>
            <identifier type="String"><![CDATA[1231231234]]></identifier>
            <isESetupNeeded type="Boolean"><![CDATA[false]]></isESetupNeeded>
            <statement type="CT_AdviceStatement">
    <isRequireStatements type="Boolean"><![CDATA[true]]></isRequireStatements>
    <statements type="CT_Statement[]">
     <item>
      <format type="String"><![CDATA[C3_S1- PJ/PJ SD POST-PRICE TAX LOT]]></format>
      <formatOther type="String" />
      <frequency type="String[]">
     <item><![CDATA[C3S1F1 Annual]]></item>
     <item><![CDATA[C3S1F2 Semi-Annual]]></item>
      </frequency>
      <firstCycle type="String"><![CDATA[C3S1_June]]></firstCycle>
      <capacityCode type="String"><![CDATA[90 C3S1_Interoffice mail]]></capacityCode>
      <numOfCopies type="Integer"><![CDATA[3]]></numOfCopies>
      <optionalCategoryChanges type="String" />
      <consolidatedAccountNumber type="String">C3_S1_111123456789</consolidatedAccountNumber>
     </item>
    </statements>
    <advices type="CT_Advice">
      <isRequireProxyReceipt type="Boolean"><![CDATA[false]]></isRequireProxyReceipt>
      <isReceiveFeeInvoices type="Boolean"><![CDATA[true]]></isReceiveFeeInvoices>
      <isRequireDuplicateFeeInvoices type="Boolean"><![CDATA[true]]></isRequireDuplicateFeeInvoices>
    </advices>
            </statement>
            <FFFC type="CT_FFFC">
              <status type="String"><![CDATA[In Progress]]></status>
              <FFFCDocumentName type="String" />
            </FFFC>
            <address type="Address">
              <address1 type="String"><![CDATA[asdf]]></address1>
              <address2 type="String" />
              <address3 type="String" />
              <address4 type="String" />
              <address5 type="String" />
              <city type="String"><![CDATA[asdf]]></city>
              <state type="String"><![CDATA[Alabama : AL : 2]]></state>
              <country type="String"><![CDATA[US]]></country>
              <postalCode type="String"><![CDATA[55555]]></postalCode>
            </address>
            <phoneNumbers type="Phone[]">
              <item>
                <type type="String"><![CDATA[Work]]></type>
                <number type="String"><![CDATA[1231231234]]></number>
              </item>
            </phoneNumbers>
            <tne type="CT_Mentials" />
          </item>
        </contacts>
        <isThisStatementParty type="Boolean"><![CDATA[true]]></isThisStatementParty>
      </item>
    </partyStatements>