Expand my Community achievements bar.

SOLVED

Adding a subform instance

Avatar

Level 1

Being relatively new to anything more complex than simple drop down lists and hiding fields, I am attempting to allow a button to insert another copy (unlimited times) of a specific subform.  I keep running into "you have reached the maximum number of items allowed." when using the preview option.  I have searched in multiple places for trying to resolve this.  I am attaching the generic form if anyone can help.  Thanks.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Here you go .....to be able to create an instance of a subform it must be within a flowed subform. I added another subform called S1 that was positioned and the set your subform to flowed. This allowed the "Repeat Subform for Multiple items" checkbox to be active on the Binding tab of the S1 subform. Then I modifed the code to point to surveySubform.S1

Paul

View solution in original post

9 Replies

Avatar

Correct answer by
Former Community Member

Here you go .....to be able to create an instance of a subform it must be within a flowed subform. I added another subform called S1 that was positioned and the set your subform to flowed. This allowed the "Repeat Subform for Multiple items" checkbox to be active on the Binding tab of the S1 subform. Then I modifed the code to point to surveySubform.S1

Paul

Avatar

Level 1

Thank you very much.  Not sure, but why is when I change the subform to 'flowed' it realigns everything, but what you provided looks the same (I sent a generic version with some items stripped out - to protect the innocent)?  As well how do I set it up to flow to an additional page if you do not mind.  Thank you very much for your help.

Avatar

Former Community Member

The flowed subform indicates that it will take all objects that it encounters and flow them on the page from top to bottom. Positioned content means that you can place objects in a subform and it will maintain their X.Y position within the subform space. So if you place your content within a positioned subform (to retain the X,Y positions, then place the positioned within a flowed subform then the flowed subform will move th eposition to the left side of the page but your objects will remain relative to the positioned subform. So make sure your positioned subform is the width of the page.

Make sense?

There is a good example of the architecture that you shoudl follow in the samples that ship with Designer. Have a look at the Dynamic Interactive Purchae Order located in this loaction in the Designer install folder:

EN\Samples\Forms\Purchase Order\Dynamic Interactive\Forms

Paul

Avatar

Level 1

Paul,

Thank you very much.  The PO example is perfect, but... When I make a few minor edits I get a "..is not a function" on the initialize.  Do I need to define these functions some place else?

Avatar

Former Community Member

You shoudl not be using any functions ....can you post your form so we can see what you have done?

Paul

Avatar

Level 1

Sorry for that - cut and paste error!  I feel confident this next item has something to do with subform(s), flow and pagination, but for the likes of me I am unable to get the table or "add survey" to go to page 2.  It just rolls down.  Ideas?

Attachment Added

Avatar

Former Community Member

You have to make your root subform (siteSurveySubForm) flowed. In doing this you will have to wrap facilityInfoSubForm and repGroupSubform into another subform so that they will not move when you make the root flowed.

Paul

Avatar

Level 1

Thanks Paul.  I got that all figured out and have gone through multiple internal reviews and all was good.  We decided to see about all of the product lines to the table.  when I did this I started getting an issue of the 'partNoScript.getDesc' not being a function.  It worked fine until I added to the array.  Is their a limit to the size of the array?  I have gone back through and insured that all of the scripts tie in line-for-line so I am not sure where to look now.

Avatar

Former Community Member

There are syntax errors in your scripting object. If you open the form in Designer, click on the scripting object in question and click the book with the checkmark icon beside the function icon. This will do a syntax check and will highlight the 1st error it comes across. There were about 5 errors in the file.

To answer your other question, there is no limit set by the software to the size of an array but there are physical memory limitations that will kick in. With such a large array you might run into performance issues.

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----