It's hard to say without knowing more about your design.
What is the relationship between the layout's table occurrence (Students?) and StudentsByPeriod.
are the portals filtered?
a look at the script that increments your Laps field might also help.
The relationship between the layout's table occurrence(Stu_Info) and StudentsbyPeriod is:
The portals are not filtered, but are sorted.
The picture below shows the script.
Stu_End_Run is neither Stu_info nor StudentsbyPeriod and you have 8 different table occurrences listed that start with that text. )n top of that, you are using a 8 repeating fields at least two repetitions though only repetition 2 is referenced anywhere in the script that you posted.
All of that sounds like the cause of your refresh issues. Can you explain what is going on in this script and how these additional relationships work?
That's an awful lot of code to just increment a lap counter.
Yes, I do have a lot of code and here is the reasoning. I wanted one layout that a teacher would go to and select which run they were going to run that day, 1-8, and that would either be 1st semester or 2nd semester. So there are 16 different possibilities for one layout, hence a lot of code. If that is the reason for a long refresh time, and I'm talking between .5 sec and 1 sec, than would it be better to create 16 different layouts? I've put more pictures below to show even more of what I've done.
There are other, far simpler ways to do this that will greatly reduce the amount of calculations and, more importantly, the need for so many table occurrences and this, in turn should result in no such delay on your layout when you tap buttons to update data in the portal rows.
I have an incomplete picture of all the tables/relationships involved so what I post next is just a first stab (and one that is likely too simple) at an example of how you might simplify this:
Periods::Period = StudentRoster::Period
StudentRoster::__pkStudentID = Laps::_fkStudentID AND
StudentRoster::gSemester = Laps::Semester AND
StudentRoster::gRun = Laps::Run
Then your button tap can perform this script:
Set Field [Laps::Laps ; Laps::Laps + 1]
If my notations used here are unfamiliar, see this thread: Common Forum Relationship and Field Notations Explained
I'm stuck with trying the example above. When I click on students in the portals, it is only adding laps to one student, the student I clicked first(ie. the first created record in table "Laps"). I must be doing something wrong, but haven't figured it out yet. Any suggestions?
I did leave out one key detail: gSemester and gRun are fields with global storage specified so that when you select/enter values in these two fields they affect to what record in Laps is accessed in all of your studentRoster records.
Did you set these fields up with global storage?
Yes, they are both set-up with global storage.
Is the button that you are clicking inside the portal row?
Is the portal based on the correct table occurrence for this simplified design?
Are the fields in the portal row from the correct table occurrence?
You might show what you now have on your layout with a new screen shot like the original.
The button I am clicking is the StudentName text field made into a button.
Yes, I believe the portal is based on the correct table occurence and the fields in the portal row are from the correct table occurence. It correctly shows the students and the field laps.
Here is a picture of the new layout with a snapshot of the relationship as well in the middle:
The relationship doesn't look right.
It appears you have __pkStudentID, gPeriod, gRun as match fields in StudentsbyPeriod, but have _fkStudentID, Run# and Semester as match fields in RunsbyPeriod.seems like you need to add Period as a match field in RunsByPeriod and gSemester as a match field in StudentsbyPeriod.
I fixed that error, but it's still not working correctly. The class rosters are showing properly in the portals, but when I check where the laps are going, in another layout, they are going to the first person in the class for that period. It is not creating a new record in the Laps table except the first record in the portal. The layout is based on TO Student_Home, the portals are based on TO StudentsbyPeriod and the two fields in the portals are RunsbyPeriod::Laps and StudentsbyPeriod::DisplayName.
Do you see corrrect counts on the layout with the portals?
Can you record different lap counts for each student on that layout?
I see counts for the first record and it equals the amount of clicks for any student clicked in the class. For example, if I click student #35 two times, student #15 three times, and student #52 once, the count for the first record is six. This is true for that class, even when gRun is changed to a different run number. It doesn't create new records for each student clicked. Here is another picture: