Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Carlos Almeida
14
Views
7
Comments
Detected a recursive iteration over the same recordlist
Question
Hi everyone!
I'm getting a "Detected a recursive iteration over the same recordlist" message in my browser when I use the GenerateRandomInteger function (I pinpointed it in debug) from the Enterprise Manager. I was using MinValue = 1 and MaxValue = MyVar and it returned this error. Also tried with MinValue = 1 and MaxValue = 10 and still the same error. Can someone help me with this please?
Thanks in advance
Carlos Almeida
Tiago Simões
Staff
Hi Carlos,
Are you sure the problem is in that action, it sounds strange?
Can you replicate that with a small example and send it?
Cheers,
Tiago Simões
Carlos Almeida
At least, when in debug, it gives that error when entering that action...
Ok, the idea here is creating a cycle that will generate a random number and search a list to find the list item with that number, sum it up to a total and break when that total passes the given limit (it's for a tool I'm developing for Dungeons and Dragons storytellers, so don't mind the names :p).
Tiago Simões
Staff
Hi Carlos,
Looking to your image it seems you are indeed iterating over the same recordlist (the two foreaches).
If that is really what you need you should use a
ListDuplicate action
and iterate over its output in the innermost foreach.
Cheers,
Tiago Simões
Carlos Almeida
Thanks Tiago. I'll try it out
Btw, on a related unrelated topic. Can one do a cycle without having for base a Record List? Like a Do While or a For kinda cycle?
Hugo Jesus
Hi Carlos.
You can use an If to do a While.
Best Regards,
hugo Jesus
Carlos Almeida
Hey Hugo
Thanks, I never thought of that xD
btw, now i'm getting a "Append is not a valid operation inside a StartIteration/EndIteration block. " error...
the cycle that it is breaking on is this:
Is this not valid? I'm appending the current record from the record list of the For Each cycle to another record list.
João Rodrigues
Staff
Hi Carlos
That error message only makes sense if the ListAppend appears inside an iteration of the list to which you are trying to append to.
Since it's not the list being used in that foreach, maybe it's the one you are using in your outmost foreach? Or even outside your action, it it's an input parameter?
Assigning lists doesn't copy them, just points the variable to the existing list, so it's not difficult to be using the same list, thinking that we are using different copies of it. If you want to copy the list you must use the ListDuplicate action.
Hope it helps.
Cheers
João
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...