Expand my Community achievements bar.

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

Is it possible to add non-contiguous instances of a subform

Avatar

Level 3

Hi there,

Our staff may fill out a form with say, 10 repeated subforms ("add instance"), then need to go back and add another instance, not after record 10, but after record 3.  Or they may need to add records in alpha order.

How can I set up the "Add Record" button so that the instance is added at that point in the form, rather than at the very end of the records?

Am I explaining this clearly? They need to go back and add an instance in between other existing instances...

Here's the form itself:

Dropbox - AFBS_90-Plus_091814.pdf

Many thanks to anyone who can help me build in this function to make our staff's life easier!

Laura

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

there is a moveInstance() method to reorder repeatable objects.

See this sample from Niall (Chapter 5: A dynamic table (additional functionality))

http://assuredynamics.com/wp-content/uploads/2010/11/Assure-Dynamics-Building-dynamic-tables.pdf

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Hi,

there is a moveInstance() method to reorder repeatable objects.

See this sample from Niall (Chapter 5: A dynamic table (additional functionality))

http://assuredynamics.com/wp-content/uploads/2010/11/Assure-Dynamics-Building-dynamic-tables.pdf

Avatar

Level 3

This is fantastic! Exactly the function we need. Thank you!!!

Okay, so I have dumb-designer questions.  I'm entirely ignorant of how to use javascript, I'm just a layout person. Sometimes just by dumb luck I manage to adapt a script and make it work in one of my own forms, but I haven't made it happen with this one yet.

Is there any resource out there I can read for how to adapt a piece of script? Like a process that needs to be followed in terms of identifying objects correctly?

Sorry if it's a dumb question, it's been a while since I've tried to do anything with javascript and I'm not havin' any luck.

Many thanks,

Laura

Avatar

Level 3

Hi Radzmar,

Please ignore that last post: I got it! I adapted the script and it's working fine.

Many thanks again, our staff are going to very happy with the changes.

Best

Laura