Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Extract data from within a dynamically rendered subform with 4 possible instances

Avatar

Avatar
Level 1
michaelt71bne
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
michaelt71bne
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
michaelt71bne
Level 1

08-01-2018

I have a form with a hidden subform containing first and last name fields ("Main.Individual.Applicant.AppName.FirstName" and "Main.Individual.Applicant.AppName.LastName").  The binding tab on the subform (called Individual) is set to repeat subform for eatch data item, Min count 0 and Max count 4.

I have a numeric field (ApplicantNum) in a separate subform (Main.BorrowerType.IndividualApplicant.ApplicantNum) that contains the following script (on exit) to generate the correct number of instances of the subform required.  So if 2 is entered in the box then 2 instances of the "Individual" subform appears.

var nApplicantNum = parseInt(this.rawValue,10);

if (nApplicantNum > 0) {

_Individual.setInstances(nApplicantNum);

}

else {

_Individual.setInstances(0);

    Main.BorrowerType.IndividualApplicant.ApplicantNum.mandatory = "disabled";

}

I also have four (static) signature fields hidden elsewhere the form.  If 2 is entered in the above ApplicantNum box, 2 of these signature fields will appear.

My problem:  I need to to be able to loop through the instantiated instances of the "Individual" subform and concatenate the first name field and last name fields and have these inserted into the appropriate applicant signature subform which contains a single field called "FullName......Signatures.Applicant1Signature.FullName and Signatures.Applicant2Signature.FullName (assuming there are 2 applicants).

Any help with this would be most appreciated.

Thanks

Michael

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

11-01-2018

You can use the resolveNodes() method to get a nodeList of repeated objects you the can process by a for loop.

var oSubforms = Main.resolveNodes("Individual[*]");

if (oSubforms.length > 0) {

    for (var i = 0; i < oSubforms.length; i += 1) {

      var cResult = "";

      cResult += oSubforms.item(i).Applicte.AppName.FirstName.rawValue;

      cResult += " ";

      cResult += oSubforms.item(i).Applicte.AppName.LastName.rawValue;

      Signatures.resolveNode("Applicant" + (i+1) + "Signature").FullName.rawValue = cResult;

    }

}