Detected a recursive iteration over the same recordlist

Detected a recursive iteration over the same recordlist

  
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
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
At least, when in debug, it gives that error when entering that action...

Image

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).
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

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?
Hi Carlos.
You can use an If to do a While.


Best Regards,
hugo Jesus

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