Insert is not a valid operation inside a StartIteration/EndIteration

Insert is not a valid operation inside a StartIteration/EndIteration

  
I am looping through the result set of an advanced query and on certain conditions, inserting a row from the results into another record list, which will then be displayed on the page. In this process, I am getting the following error:

"Insert is not a valid operation inside a StartIteration/EndIteration"

I am not inserting into the source list, but into a local variable record list. If there;s another/better way to do this, please let me know.
Hello John

Are you using a local record to do the insert or using the current from the record list?

You need to use insert in a specific position? If yes just use a local record and next insert on the local record list;

Always can use list append to put the record on the bottom of the list

I hope that helps
Regards
Hello, John

I'm sorry to insist, but are you sure you aren't trying to insert in the list that is currently being iterated? I tryed to recreate your error but the only way I found to achieve this error was inserting the new record to the list I was iterating.

And as Hugo has said, do you need a specific postion on the list? If you don't, use ListAppend.

Best regards,
Pedro Magalhães