Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Button to add another instance of a subform

Avatar

Level 2

Also.....

Need to add a button to add another instance of a subform

Tried this, just brings up error message You have reached the maximum number of items allowed

form1.OpportunitySubform.AddSubformButton1::click - (JavaScript, client)

/* This button will Add one instance of the repeating subform or table row.

sSubformSOM: SOM expression of the repeating subform or table row.

bCalc: Flag - true if the new instance might be referenced by other calculations, otherwise false.

message: The error message displayed.

These variables must be assigned for this script to run correctly.

Replace <value> with the correct value.

*/

var

sSubformSOM = "xfa.form.form1.OpportunitySubform"; // Example: var sSubformSOM = "xfa.form.form1.Subform1";

var

bCalc = false; // Example: var bCalc = false;

var

message = "You have reached the maximum number of items allowed.";

 

// DO NOT MODIFY THE CODE BEYOND THIS POINT - 8.2.1.4029.1.523496.503679 - Subform_Instance_Controls_Add.xfo

1 Accepted Solution

Avatar

Correct answer by
Level 10

Your code does not show the syntax to add Instance of the subform.

From the error message it seems to be you did not set the subform to repeat for each item.(check the image).

Thanks

Srini

Subform Instance.JPG

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Your code does not show the syntax to add Instance of the subform.

From the error message it seems to be you did not set the subform to repeat for each item.(check the image).

Thanks

Srini

Subform Instance.JPG

Avatar

Level 2

Thanks Srini

Easy when you know how!