Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7848 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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

Posted

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, " par.gif")

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)

Posted

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

Posted

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

This topic is 7848 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.