Jump to content

Script a SEARCH across 4 Fields


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

Recommended Posts

Greetings. New to the forum, using FMP14 on a Mac running Mavericks, FMP novice, aviation industry.

Right... I think the best way to get to where I need to be is provide a little background: I'm working in what would politely be termed a 3rd World area -Papua in Indonesia, to be precise. There is not a lot in the way of structured organisation at a professional level here. I have developed (over the last 4 years or so) a database of navigational waypoints which we use here daily. I have sourced the data from a fairly diverse range of sources and now have a database that is really quite useful, after having undergone several structural changes as I have learned where the original data has come from, conventions that were used to build it and of course, proven the validity of the data myself before using it operationally.

Therein lies the problem:

Many organisations have contributed to the entirety I now have, with little-to-no consultation or cooperation between them. I have waypoint identifiers I have had to:

1. Record existing data and remove duplicates

2. Assign a unique identifier to each waypoint

3. Sort the existing (not necessarily unique) name into an appropriate field, where possible i.e. ICAO and/or IATA identifiers, or another field to contain the existing name where it fits no other field... this because many existing documents still refer to these "old" identifiers, so they still need to be stored and accessible when required.

Then comes my problem: I have to be able to search them and pull up all the relevant information on the waypoint. I am often provided only partial information with a request for data, so unless I'm Very lucky, I wind-up executing anything up to a dozen Find's on 4 fields to get where I want to be! Frustrating and costing a Lot of time. I have over 900 waypoints recorded here now.

What I would like to be able to do is:

Execute a Script that will pop-up a box that I can enter the known search parameters into, then have it  search the 4 fields for that string and return the results.

Sounds pretty simple when you say it quickly ;-) I've spent a lot of time searching & trying whatever I could find, without success. Many "hot leads" have fizzled, having been suggested or written for versions earlier than 14.

I'm far from expert in FMP or Script writing... but am able to follow simple instructions, as long as you type s l o w l y ;-)

Many thanks in advance for any suggestions, tips or pointers -and thanks for your patience in reading this far ;-)

Link to comment
Share on other sites

Alot depends on how your data is structured.

For the sake of argument lets pretend the finds all need to be done on 4 different fields in the same table.

Create a global storage text field.

Find pseudocode....

Show a custom dialog that asks the user for the find criteria and stores it in the global field.

set variable to the contents of the global field

Add any find operators that wil make the search criteria fit the case.

make sure your on the right layout for the table.

enter find mode

Set field 1 to the variable

new record/request

Set field 2 to the variable

New record/request

Set field 3 to the variable

New Record/request

Set field 4 to the variable

Perform find

Link to comment
Share on other sites

This topic is 2252 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
 Share

×
×
  • Create New...

Important Information

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