Hi, We want to add a form during runtime. This form should be be the first form in print order. Its like a coverpage. The intent is to find the first form after Gendata has run and add another form before the first form. We tried Addform option but it only allows to add the form after a form and not before it.
this may not be the answer, atleast it can help others to bring in the ideas
Add a DUMMY form at the beginning of the FORMLIST.
After GENDATA is complete, add <yourform> after the DUMMY using AddForm()
then delete the DUMMY form using DelForm("DUMMY").
I hope there will not be any blank page at the beginning of the printset
Turn your logic inside-out.This is similar to the "Dummy form" suggestion, but more straightforward. Always trigger the optional form at the beginning of the forms list. Where you currently have the script deciding to add the form, you invert that and have it decide when to remove the form instead.
So instead of:
change it to
if (ThisAnswer() = 0)
The heart of your script can remain the same while you simply change it to act on the opposite answer.