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

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

Recommended Posts

Posted

I have a list of records in Browse Mode (FM 8.5)and wish to create an A B C... listing on the footer so that when a user clicks on say... "C" the script will list immediately and moves to the first occurance of an Upper(Left([fieldname],1))="C" etc. etc. and redisplaying said records from the top of the screen.

Would appreciate any ideas as I am still banging my head with some of the new elements of this version.

Roy B

Posted

This is one of those things that has changed a lot.

Left (YourField; 1) //Use your last name field for the YourField

Your script will be something like:

Set Error Capture [ On ]

Enter Find Mode [ ]

Set Field [ YourField; Get (ScriptParameter) ]

Perform Find [ ]

If [ Get (LastError) <> 0 ]

Show Custom Dialog [ Title: "Warning"; Message: "No records found."; Buttons: “OK” ]

Show All Records

End If

Next, attach the script to your buttons using the Script Parameter. Before v8, you would have to copy the script for each button.

HTH

Lee

Posted

Hello Lee;

Thank you for the response however, being new to this, I am somewhat confused with the ScriptParameter area of:

Set Field [ YourField; Get (ScriptParameter) ]

If I have a footer menu... A - B - C.. Z, etc. and I attach the script to run on clicking say.. B, and the fact that you say you don't have to create a new script for each letter of the menu, how does the Perfom Find[] know which letter the user is clicking and to search for the first occurance of a Surname starting with the letter "B" ?

Is there any simple learning aids or text out there that provides simpler explanations on how to use ScriptParams, etc. ? The help screens with FM 8 are written for people who know FM inside out.

Regards,

RB

Posted

Script parameters are basically values that you can pass along when your script is being called. You can typically pass a script parameter when assigning a script to a button or when you are calling a subscript from a script.

In your button setup under the "specify script" section, there should be a 'Optional Script Parameter' entry box on the bottom. So for each button, pass the letter that you want as a parameter to the same script. i.e. First button "A", second button "B", etc etc. That way you will only need one script as Lee stated.

Posted (edited)

I can only add, The screen shot shows what we are saying, I hope.

Note the "G" is where you will change the Script Parameter for each letter.

HTH

Lee

screenshoot.jpg

Edited by Guest
Posted

Thank you Lee, now I get the drift, and it works.

It displays however all records that contain the parameter (i.e. "G") within the fieldname chosen rather than displaying records where the parameter is equal only to the first letter of the fieldname.

Any suggestions?

Regards,

Roy

Posted

Hello Lee;

Marvelous what a little brain crunching does. I cured the problem... I created an ID_Alpa field that extracts the first letter of all surnames and placed that field in the SETFIELD search ScriptParameter. Works like a dream.

Having said that I'm sure there's another way to do it without adding more resources to the file but I'm sure someone will advise me down the line.

Many thanks.

Chef Roy

Posted

Look at my first post again.

[color:blue]Left (YourField; 1) //Use your last name field for the YourField

I'm glad you got it figured out now. Feels good huh?

Lee

This topic is 6463 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.