0
votes

I'm using `MultiSelectionHelper, my code is this :

MyView currentRecord;
MultiSelectionHelper helper = MultiSelectionHelper::construct();
helper.parmDatasource(MyView_ds);

currentRecord = _helper.getFirst();

while (currentRecord)
{
   // to do action
   currentRecord= helper.getNext();
}

But the problem in while loop not stop when see in Debug currentRecord.RecId = 0 , map = Common

The cycle don't stop, and continue without record!

1
You have _helper and helper. Is this a typo or a bug? - Alex Kwitny
MultiSelectionHelper does record caching. You can try moving your code to/from the client or server and/or restarting your AOS and clearing your user caches. - Alex Kwitny
Hi @ Alex Kwitny, thanks, I moved my code in Form's active method, add while(currentRecord.RecId) . - ulisses
It seems odd to have this code in a form's active method. I'm not sure what you're trying to accomplish but I would think there's another way. I suspect your issue may have been due to the location of your code. - Alex Kwitny

1 Answers

0
votes

Maybe you need to change your while condition like the following:

MyView currentRecord;
MultiSelectionHelper helper = MultiSelectionHelper::construct();
helper.parmDatasource(MyView_ds);

currentRecord = _helper.getFirst();

while (currentRecord.RecId != 0)
{
   // to do action
   currentRecord= helper.getNext();
}

If this doesn't work please refresh the cache and data from tools menu. This will surely solve the problem.