AnsweredAssumed Answered

Script does not capture next portal row on first click

Question asked by alangodfrey on Jul 28, 2016
Latest reply on Jul 29, 2016 by alangodfrey

I have a portal that users can click in to select a Resident's record to display.  They often want to progress down the portal list, viewing a record, then the next, then the next, etc.  To make it easier for them I collect the ID of the record they want to view (obviously) and display it, but I also collect the ID of the next record in the portal.  They can see who the next Resident will be, and clicking a 'Next' button shows them that 'next' Resident's record, and traps the new 'next' Resident.


So they can click on the first record in the portal, then use the 'Next' button to 'walk' down the list.  The problem is it the 'Next' button fails when used the first time, but works every time after that.  So: click on record 1 in the portal, and it will correctly show record 1 and note that record 2 is next in the queue.  Clicking on the 'Next' button will load record 2, but show (wrongly) that the 'Next' record is still 2.  Clicking again, will correctly move on through record 3, 4, etc.


I have attached a stripped down sample of the problem - in the real file I have other error checks, and checks for the first or last record, and also the ability to walk back 'up' the portal, but this has me stumped.  Using the Script debugger shows everything going correctly visually (I can see the correct portal row is correctly selected) but the data it displays is consistent with the problem.  I just can't see why the ID from the 'active' row is correctly collected every time except the first time.


All help gratefully received - thanks.

(The file is being developed in version 11, but I have converted it to version 14 and it still displays the same problem.)