cancel
Showing results for 
Search instead for 
Did you mean: 

Loop Over Collection.

dm21
Participant
0 Kudos

Hi,

Is it possible to select a record and then loop over to the next and previous records in agentry,I can see loop over collection and loop over displayed list works from the begging of the collection but i want to select a particular record and then loop over to the next .I tried loop over selected display list items and it was only looping the selected record again and again, also i tried loop over collection and displayed list items with collection set to selected record.

Please help.

Thanks and Regards,

Deepak.M

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

if you know the sort criterium and you can guarantee that there are no two objects with the same value, you can do some stunts with the execution rule.

Assuming you have a fixed sort property "SortNo", you want to loop over all objects, that a) have a SortNo that is no smaller than the maximum SortNo that is smaller than the SortNo of the selected object and b) have a SortNo that is at most the minimum SortNo that is larger than the SortNo of the selected object. Your execution rule could look like this:

- AND

     - GTEQ

          - SortNo

          - Collection_Max

               - TheCollection

               - LT

                    - SortNo

                    - TheListTileView > Selected record

     - LTEQ

          - SortNo

          - Collection_Min

               - TheCollection

               - GT

                    - SortNo

                    - TheListTileView > Selected record

Regards, Daniel

dm21
Participant
0 Kudos

Hi,

Thanks for your quick reply,

I tried doing what you said,But it isn't working.Do you have any other work around in achieving this ?

Thanks,

Deepak.M

Former Member
0 Kudos

Hi,

the rule looks pretty okay to me. What do you mean by "isn't working"? Is the action executed for each object or for no object? What does the action do, is there an enable rule or a missing target preventing the action to be executed?

Maybe you can try to just use a message step in the subaction and remove all other steps from the action in which you execute the subaction-loop.

Also you can try to use the Test Environment to debug the execution rule.

Regards, Daniel

dm21
Participant
0 Kudos

Hi Daniel,

The problem is that when i click on the button nothing is happening ,I tried with different ways by changing the rule structure but no luck.

Now I am able to select a particular record and the loop starts with the record that i selected but the problem now is after the selected record ,Its agains starts from the beggining and loops over the entire collection.

Please suggest.

Thanks,

Deepak.M

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Deepak,

I believe this is a known issue currently.  I would suggest contacting support regarding this for more details.

--Bill