May 28, 200223 yr Newbies I have a portal with studentsnumers and an icon with letter send/unsend. When i click on the icon a letter is printed and the icon for that one student is set from unsend to send When i shift click on the icon the letters for al the students in this portal are printed and all the icons are set from unsend to send. One problem with following script --> it never stops. It doesn't exit on the last record. Go to Portal Row (first, select entire contents) Set field (T_Students::bevestigingsbrief,3) Loop Go to Portal Row (next,select entire contents, exit after last) Set field (T_Students::bevestigingsbrief,3) End Loop
May 28, 200223 yr I suspect you may never be getting past record 2 in the portal. Put a "pause" in the loop so you can see the progress down the portal. Incidentally, you need a scroll bar on the portal, otherwise "Go To Next Portal Row" does not work.
May 28, 200223 yr If your portal allows creation of related records you'll always have a Next portal row and the loop will never stop ... Looping thru portal rows can be done, but it has some problematic aspects ... I usually prefer to do things in the related file ...
May 28, 200223 yr Do the looping stuff in the related database. not the portal. In the master database the script should look like this: Allow User Abort [off] <stuff> Freeze Window Go to Related Records [relationship, show only related records] Perform Script [external, relatedfile::portal-looping-script] Refresh Window [bring to front] The "Go to Related Records [relationship, show only related records]" step has the effect of performing a find in the related database, so that when the "portal-looping-script" is run in the related file the current found set are the related records. Neat huh! The "Refresh Window [bring to front]" step at the end makes the script return to the file where it started, so to the user it looks like all the action has taken place in the current window.
Create an account or sign in to comment