Newbies jull Posted May 28, 2002 Newbies Posted May 28, 2002 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
IdealData Posted May 28, 2002 Posted May 28, 2002 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.
Pupiweb Posted May 28, 2002 Posted May 28, 2002 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 ...
Vaughan Posted May 28, 2002 Posted May 28, 2002 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.
Recommended Posts
This topic is 8216 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now