June 2, 200322 yr Hi! Is it possible to have a script be activated by pressing the "return" key? I have a search page that I want my users to be able to just hit return after they have typed in their criteria which will then run a script that will take them to a list page.
June 2, 200322 yr Hi: Well, when you are in Find Mode (as when you are doing a search) hitting enter will perform the find. You could have a script take the user to the search page, enter find mode [pause], have them enter search criteria, perform find [ ], and whatever else you want. Other than that, there is a few plugins that can activate upon field activity. One is called Oazium Events. Ken
June 2, 200322 yr Well, It's kind of limited use, but I already used it, and the user liked it, so... It works for one field only You can only enter a value without carriage return in it Add these fields to your file g_countreturns (numeric) c_countreturns = Patterncount(Field X, " ") Field X at left side is a global field involved in a relationship Global::Related File:FieldX(indexed) Then the script will go : Go to Layout (Search) SetField(g_countreturns,0) Loop End Loop If (c_countreturns>g_countreturns) Go to field X (select) Pause/Resume (00:00:01) End Loop Insert Calculated result (Substitute(field X,Right(field X,1),"") If(Is Valid(your relationship) Go To Related Records Perform External script (go to List Layout) As you can see, the script is perform when a new carriage is introduced which limits the use of this script to single relationship match (not multikey)
June 2, 200322 yr Hi, As I wasn't so sure of the script, I attached it to a demo file. This demo contains other "find tips". Yours is attached in the small tabbed interface button labelled "Adv Search" or simply choose the last script attached to the file. You'll have to go to the form mode to try it again. Well, of course, you should turn the Allow user Abort and Error Capture in the definitive version. But it works fine. Booksv2.fp5.zip
June 3, 200322 yr Other than methods pointed to you be Ugo and Ken you could try the following: Define the "Find Script" Allow user abort [off] Set Error Capture [on] Go To Layout ["find layout"] Enter Find Mode[ ] Freeze Window Pause/Resume Script [ ]//for ever Perform find [ ] If [status(CurrentFoundCount)] If [status(CurrentFoundCount)=1] Go ToLayout [form] else Go ToLayout end if else //Handle errors, show message etc end if Dj
Create an account or sign in to comment