Expand my Community achievements bar.

SOLVED

Creating new duplicate sheets

Avatar

Former Community Member

Hi - total noob here I am afraid

I have created a surveying template with the first 3 pages generic to every survey/project and then the 4th that should be able to be duplicated as many times as required (ie one per room being surveyed)

Is there anyway of adding a little macro or similar that if a button pressed a copy (blank) of sheet four will be created as sheet 5 and so on?

edited....I have read elsewhere to use subforms and flowing - is there an idiots guide anywhere, I already have the page setup...and when I wrap the sheet with a subform and then flow it the formating goes everywhere and into 3 pages ...

thanks in advance, I have attached the survey file if anyone can help it would be appreciated

Sph

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I added a button on page 4 and called it 'addPageBtn'. The click event for the button adds a new instance of page 4. The form is attached.

// form1.page4.addPageBtn::click - (JavaScript, client)

form1.page4.instanceManager.addInstance(1);

Steve

View solution in original post

4 Replies

Avatar

Correct answer by
Former Community Member

I added a button on page 4 and called it 'addPageBtn'. The click event for the button adds a new instance of page 4. The form is attached.

// form1.page4.addPageBtn::click - (JavaScript, client)

form1.page4.instanceManager.addInstance(1);

Steve

Avatar

Former Community Member

thank you... but how do I see the java...do I see it in LiveCycle or do I edit that in Adobe?

sorry exactly what I wanted but cant see the script area in LiveCyle and would like to know how to do it again in the future

many thanks though..great help!

Avatar

Former Community Member

First, the Script Editor has to be viewable. If it is not, go to the tool bar, click 'Window', and 'Script Editor'.

Second, click on the 'addPageBtn'. In the upper-left corner of the Script Editor you can choose an event and view the script associated with the event. For the 'addPageBtn' button the JavaScript is attached to the click event.

Avatar

Former Community Member

many thanks....you have saved me hours of head scratching...appreciated.

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] ----