rossination Posted July 14, 2006 Posted July 14, 2006 (edited) In Scriptmaker, is there a way to use the contents of a global field as the query for a find request? How do I do this? Or is the answer right under my nose? Thanks all - Daniel Edited July 14, 2006 by Guest
rossination Posted July 14, 2006 Author Posted July 14, 2006 WEll, this page makes it pretty clear that I can't. Is there another way of accomplishing this? I want to be able to run a script where it asks the user for some text, and that text is used for a find.
Ender Posted July 14, 2006 Posted July 14, 2006 If data is entered into the globals while in Browse Mode, you can use that data in Find Mode to set criteria into fields. The script steps are pretty straight forward: //Assume gSalesperson is a global with a value already set Enter Find Mode [] Set Field [ Salesperson ; gSalesperson ] Perform Find []
Ted S Posted July 14, 2006 Posted July 14, 2006 Yup. If I understand the question the answer is pretty simple. 1. Create a field in either that same table you are searching or another table. Format it as TEXT type (I assume) and set the storage as GLOBAL. In this example I'm calling it: TempText1 2. Make a script something like this: Show Custom Dialog [Table::TempText1]* Enter Find Mode [] Set Field [Table::YourNormalField; Table::TempText1] Perform Find [] *When you're setting up the custom dialog you will need to use an input field. See the INPUT FIELD tab. It is there where you will specify the Table::TempText1 field. This script is the bare minimum. You may want to consider error handling too but this example should get you on your way.
Ted S Posted July 14, 2006 Posted July 14, 2006 Rats! Missed by "that" much. Remember Don Adams as Maxwell Smart?
rossination Posted July 14, 2006 Author Posted July 14, 2006 Thanks, guys - worked like a charm. Now I find myself with another problem, though: My global field will include the name of another field. How, in my script, do I go to that field? If it were a one-time thing, I would just hard-code the field into the script. But the field that I want to go to will change every time.
Ender Posted July 14, 2006 Posted July 14, 2006 Check out the getfield() function. Remember Don Adams as Maxwell Smart? Sure Chief.
Ted S Posted July 15, 2006 Posted July 15, 2006 Ender, you're showing your age; I thought you were a youngster... I was just thinking; agent 99 IS probably 99 now!
Ender Posted July 15, 2006 Posted July 15, 2006 Naw, I was just glued to the re-runs back in my childhood. I liked how the doors opened & closed at the start & end of every show.
Recommended Posts
This topic is 6709 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 accountSign in
Already have an account? Sign in here.
Sign In Now