Mattg-zzz Posted August 6, 2006 Posted August 6, 2006 I am trying to write a script that would let me search for a particular phone number in 4 different fields (home phone, wk phone...). thanks
Genx Posted August 6, 2006 Posted August 6, 2006 Again... had this been in related structure it wouldn't be a problem. You'll have to specify four different requests in this case. (Enter Find Mode, set work phone, new request, set home phone, new request etc. etc. perform find)
Mattg-zzz Posted August 6, 2006 Author Posted August 6, 2006 How can I change it to related structure. How do I set up a script to do the find.
Genx Posted August 6, 2006 Posted August 6, 2006 To setup the related structure, you will need a primary key in your main table. Then create a secondary "numbers" table. In that table, create a "foreign" key field, a "Type" field and a "Number" field... all text. Next, relate your main table to your secondary table by primary key to foreign key -- (double click your newley formed relationship - and on the child side (your numbers table) turn on Allow Creation of records in this table via this relationship). Then go back to your main layout -- make sure its based on your Main Table TO... add a portal to the numbers table, add the Type and Number field, and voila - you have related structure. Or search... You'll have to create a layout with global fields to accomplish this... Create your layout - one field of which is the phone number field. Take the user to this layout to search, then, have them hit a search button which... takes the phone number, goes to the real layout, generates 4 find requests, one for each number type and then searches... e..g Go To Layout[Main Layout] Enter Find Mode[] Set Field[MainTable::WorkPhone ; globalNumber] New Record / Request[] Set Field[MainTable::HomePhone ; globalNumber] . . . . Perform Find[]
Mattg-zzz Posted August 7, 2006 Author Posted August 7, 2006 Thanks again for the search help. It worked great. :
Recommended Posts
This topic is 6683 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