Lookup and display current information on forms and views

Lookup and display current information on forms and views

My Zoho Creator database has a one to many relationship of one skater to many tests passed.  In several views, I need to be able to display the highest test passed of three different test types (Moves, Dance, and Free) for each skater.  I have successfully created fields in the Skater Information form which are populated on form success.  The script in the form looks for the highest test of three different test types and places the high test number and name in fields in the form.  I can display those fields in a view.  The problem is - if a test is added later, the form does not recalculate the new high test unless it is edited.  Can I run a daily script to force update the Skater Information forms?  Is there a way to calculate and display this in a view instead of the form?  What is the best way to approach this?

Upon Succuss in the Skater Information form, I have the following:

  1. if (count(Tests_Passed[(Skater_Unique_ID == input.Skater_Unique_ID && Test_Type == "USFS Moves")])  !=  0)
  2. {
  3.     moveslist  =  Tests_Passed  [(Skater_Unique_ID == input.Skater_Unique_ID && Test_Type == "USFS Moves")] sort by  Test_Number ;
  4.     moveslength = (((moveslist.Test_Number.getall()).toString())).length();
  5.     movesstart = (moveslength  -  1);
  6.     moveslast = ((moveslist.Test_Number.getall()).toString()).subString(movesstart,moveslength);
  7.     input.Max_Moves_Number = moveslast.toLong();
  8.     MovesNameVar  =  Tests  [(Test_Number == input.Max_Moves_Number && Test_Type = "USFS Moves")];
  9.     input.Max_Moves_Name = MovesNameVar.Test_Name;
  10. }
  11. if (count(Tests_Passed[(Skater_Unique_ID == input.Skater_Unique_ID && Test_Type == "USFS Pattern Dance")])  !=  0)
  12. {
  13.     dancelist  =  Tests_Passed  [(Skater_Unique_ID == input.Skater_Unique_ID && Test_Type == "USFS Pattern Dance")] sort by  Test_Number ;
  14.     dancelength = (((dancelist.Test_Number.getall()).toString())).length();
  15.     dancestart = (dancelength  -  1);
  16.     dancelast = ((dancelist.Test_Number.getall()).toString()).subString(dancestart,dancelength);
  17.     input.Max_Dance_Number = dancelast.toLong();
  18.     DanceNameVar  =  Tests  [(Test_Number == input.Max_Dance_Number && Test_Type = "USFS Pattern Dance")];
  19.     input.Max_Dance_Name = DanceNameVar.Test_Name;
  20. }
  21. if (count(Tests_Passed[(Skater_Unique_ID == input.Skater_Unique_ID && Test_Type == "USFS Freestyle")])  !=  0)
  22. {
  23.     freelist  =  Tests_Passed  [(Skater_Unique_ID == input.Skater_Unique_ID && Test_Type == "USFS Freestyle")] sort by  Test_Number ;
  24.     freelength = (((freelist.Test_Number.getall()).toString())).length();
  25.     freestart = (freelength  -  1);
  26.     freelast = ((freelist.Test_Number.getall()).toString()).subString(freestart,freelength);
  27.     input.Max_Free_Number = freelast.toLong();
  28.     FreeNameVar  =  Tests  [(Test_Number == input.Max_Free_Number && Test_Type = "USFS Freestyle")];
  29.     input.Max_Free_Name = FreeNameVar.Test_Name;
  30. }

In addition, on a roster (a view), I need to be able to display the highest Moves test passed as of a test deadline date for each skater each season, and I need to show the age of each skater as of an age deadline date each season.  I have a one to many relationship of one skater to many team assignments.  A skater may be on more than one team each season.  I need to be able to see the historical data of past seasons.

On the team assignment form, I have

  1. if (count(Seasons[Season_Name == input.Season_Name])  !=  0)
  2. {
  3.     SeasonsVar  =  Seasons  [Season_Name == input.Season_Name];
  4. }
  5. if (count(Skater_Information[Skater_Unique_ID == input.Skater_Unique_ID])  !=  0)
  6. {
  7.     SkaterVar  =  Skater_Information  [Skater_Unique_ID == input.Skater_Unique_ID];
  8. }
  9. if ((SeasonsVar.Age_Deadline  !=  null)  &&  (SkaterVar.Skater_DOB  !=  null))
  10. {
  11.     input.Age_At_Deadline = ((SeasonsVar.Age_Deadline - SkaterVar.Skater_DOB)  /  (1000  *  3600  *  24  *  365)).round(1);
  12. }
  13. if (count(Tests_Passed[((Skater_Unique_ID == input.Skater_Unique_ID && Passed_Before_Date <= SeasonsVar.Test_Deadline) && Test_Type == "USFS Moves")])  !=  0)
  14. {
  15.     Moveslist  =  Tests_Passed  [((Skater_Unique_ID == input.Skater_Unique_ID && Passed_Before_Date <= SeasonsVar.Test_Deadline) && Test_Type == "USFS Moves")] sort by  Test_Number ;
  16.     length = (((Moveslist.Test_Number.getall()).toString())).length();
  17.     start = (length  -  1);
  18.     last = ((Moveslist.Test_Number.getall()).toString()).subString(start,length);
  19.     input.Max_Moves_Number = last.toLong();
  20.     TestsVar  =  Tests  [Test_Number == input.Max_Moves_Number];
  21.     input.Max_Moves_At_Deadline = TestsVar.Test_Name;
  22. }
  23. input.Roster_Count = 1;

Again - this works until a new test is added.  I need my forms and view to always show current information.  I would be grateful for any assistance.  Thank  you.