AnsweredAssumed Answered

Better Script for Go To Portal Row

Question asked by deathrobot on May 15, 2013
Latest reply on May 15, 2013 by deathrobot

Title

Better Script for Go To Portal Row

Post

     Hi. I'm trying to make an alphabet picker where you can click on a letter of the alphabet and go to the frist record in a portal that starts with that record. I've got something that works, but 1) It's EXTREMELY slow and 2) it's not smart enough to go to the previous letter in the alphabet if there are no records that start with the letter the user clicks on. Here's what I've got. Is this idea even feasible? The table has over 7,000 records in it.

     __________

     Go to Object [Object Name: "Picker Portal"]  /* Portal Picker is the name of the portal that shows all the records */
     Go to Portal Row [Select; First]
     Loop
          Exit Loop If [Left(com_COMPANIES_filtered:name; 1) = Get(ScriptParameter)} */ScriptParameter is whatever letter the user clicks on */
          Got to Portal Row [Select; Next; Exit after last]
     End Loop
     If [Left(com_COMPANIES_filtered:name; 1) -/= (does not) Get(ScriptParameter)]
          Go to Portal Row [First]
     End If

     __________

     Thanks.

     Michael

     P.S. Is there a way to copy scripts to paste here without having to copy them by hand?

Outcomes