Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Dynamic form page generation question

Avatar

Former Community Member

Hi, I would like to do the following but need some help:

I have a stand-alone PDF form, fully Reader-extended.

It has 5 pages,

on page #1, there is an numeric field,

what I want to do is,

say for example, when the user enters a number (integer) 3,

I want it to dynamically generate 3 sets of (page #2 + page #3)...

so, the final result is this:

page 1,

page 2,

page 3,

page 4, (same as page #2)

page 5, (same as page #3)

page 6, (same as page #2)

page 7, (same as page #3)

page 8, (same as page #2)

page 9, (same as page #3)

page 10, (the original page #4)

page 11 (the original page #5)

how to do this? could any one help please?

if would be great if you have a sample that I can model after.

TIA

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi,

If pages 2 & 3 can use the same Master Page try:

Page1

Page2

--SubformPages2and3

----SubformPage2

----SubformPage3

Page4

Etc.

  • restrict "Page1" occurance to 1
  • you could set the restrict "Page2" occurance to 2 x the max occurance  of  "_SubformPages2and3"      
  • set Binding to Repeat Subform (be sure to set a Max) & check  "allow page breaks" in the Subform tab of the Object Pallet of "SubformPages2and3" 
  • Un-check "allow page breaks" in the Subform tab of the Object Pallet of "SubformPage2"
  • Un-check "allow page breaks" in the Subform tab of the Object Pallet of "SubformPage3"

Then use on the exit event of the numericField

var numRepeat = numericField

_SubformPages2and3.setInstance(numRepeat)

//  or in JavaScript

var numRepeat = numericField.rawValue;

_SubformPages2and3.setInstance(numRepeat);

I would consider a dropdown box instead of a numeric field to avoid the "exceeded max number of instances" error messages when the user puts in too many.

or

use a comb of 1 or set the patterns to only allow 1 numeric character.

I hope this helps!

Stephen

Message was edited by: kingphysh

View solution in original post

2 Replies

Avatar

Correct answer by
Level 7

Hi,

If pages 2 & 3 can use the same Master Page try:

Page1

Page2

--SubformPages2and3

----SubformPage2

----SubformPage3

Page4

Etc.

  • restrict "Page1" occurance to 1
  • you could set the restrict "Page2" occurance to 2 x the max occurance  of  "_SubformPages2and3"      
  • set Binding to Repeat Subform (be sure to set a Max) & check  "allow page breaks" in the Subform tab of the Object Pallet of "SubformPages2and3" 
  • Un-check "allow page breaks" in the Subform tab of the Object Pallet of "SubformPage2"
  • Un-check "allow page breaks" in the Subform tab of the Object Pallet of "SubformPage3"

Then use on the exit event of the numericField

var numRepeat = numericField

_SubformPages2and3.setInstance(numRepeat)

//  or in JavaScript

var numRepeat = numericField.rawValue;

_SubformPages2and3.setInstance(numRepeat);

I would consider a dropdown box instead of a numeric field to avoid the "exceeded max number of instances" error messages when the user puts in too many.

or

use a comb of 1 or set the patterns to only allow 1 numeric character.

I hope this helps!

Stephen

Message was edited by: kingphysh