So you could potentially use an OnObjectModify script trigger on that drop down that does the following:
Set Variable [ $type ; referral::referralType ]
New Window [ "Select Therapist" ]
Enter find mode (uncheck pause)
Go To Layout [therapists selection list]
Set Field [ therapists::type ; $type ]
scroll window [home]
As a trigger, anytime that someone changes the value using that dropdown, it would open a new window, go to a list of therapists, perform the find for the type of therapist that was selected, sort and go to the top of the list.
Then, you need a button next to each therapist on the list that performs the following:
Set Variable [ $therapist ; therapists::primaryKey ]
Close Window [ "Select Therapist" ]
Set Field [ referral::therapistForeignKey ; $therapist ]
Commit Record [ no dialog ]
Your referral record could then pull the related data directly from the therapist's table.
I'll give that a try and get back to you.
The best way to search for (and choose) is to never forget what your goal is.
You have a patient, and you have a referral type. Your goal is (or should be) "the best possible for my patient".
Which in turn means that you must have a sort order for the referral names, one different from alphabetic. You need a name portal filtered by referral type and sorted by "stars" desc, a rating you must care about and modify by getting input from your own patients after their interaction with the referred. You print the first 4 names on your list and the patient will try to get an appointment with them. Or you do it for them.
When the patient gives you a name of a referral you don't have in your list, ask why. Try to find out more. Establish contact, but do defend your favorites, professionists you trust and your other patients are fond of, by explaining to the patient what makes them worthwhile being considered.
The "how to" and "where to click" are the last layers you should consider
Your request is for a popup list of referals to select from based on the value entered in another field.
Attached is a file with two tables, the simplest method of all:
Report - I chose this name but it can be whatever is appropriate. This is the form you fill in for the patient
Provider - a list of make believe doctors with my non-medical type of referals.
Open the two as a table and you can see what I entered and enter your own data for testing. The paatient is just a number.
Attached is a sample file that shows one method of using a conditional value list that depends upon the values entered in another field. Also note that I have entered multiple referal types for some of the providers and each is selected accordingly.
Study how the value lists were assigned. One derives its values from the provider records and the other is the conditional value list that depends upon the linking field.
If you wish to go to the tab, name your tabs the same as the referal type. Then add a trigger (on save) to the popup menu with a script that says Go to Tab Object (referal type)
Simple, clean, done.
So, I didn't notice that part of the question. I could add it in if the instructions aren't clear.
Actually I did and have replaced the file.
It took less than 2 minutes to add the tabs, name them and attach the one line script to the popup.
I just added a slight touchup so the providers name is removed if you select another referal type.
Providers.fmp12.zip 67.6 K
Kinda complex. Check the file I uploaded for a simple technique.
Hi Peter, Jack's suggestion of a single database file with two tables also makes sense to me as a place to start. He did provide an attachment -- do you see it at the bottom left of his posting?
In your original posting, you wrote "I have a DB set aside just for providers and also have providers mixed in with my list of practice contacts using the contacts quick start db and am open to doing it either way but prefer to keep the db of providers separate."
It sounds like you just want to keep the providers in a separate table, not in a separate database file. Is that correct?
After you get a better grasp of the options for filtering relationships, you may decide that you can place patients and providers in the same Contacts table. Or there may continue to be very good reasons to keep them separate -- that's a decision you'll want to return to as you continue to develop your solution.
Cheers -- Mark
I was open to doing it either way, but it seems to make more sense to me to just have a separate table and keep everything in one database. I'm still developing, and learning as I go so I appreciate you pointing out alteranatives.
I uploaded a db that did what you asked an emailed you a copy when you asked but you have not responded? Any problem with the file?
Yeah so I looked at what you had sent me, just been backed up with other work things. I didn't really understand the purpose of the tab control at the bottom of what you sent me. Here is a snip from my database. Maybe this will make it a little more clear what I am trying to do.
The Referral To box says <Table Missing> right now. What I am trying to do is set it up so that when the referral type I wish to make is to physical therapy, if I choose that setting on the drop down, it will take me to a list of physical therapists based upon my Providers Table. The Providers table looks like this:
I want it to show all of the providers in my Provider table that have a Provider type of Physical Therapy from the drop down on field #2. Likewise if referring to a massage therapist it will do the same. However, the Referral form needs to provide the patient with the providers address and at least a phone number. Hope this clarifies what I'm trying to do. I appreciate your feedback.
Welcome to the FileMaker world... The best way to write scripts is to look at other examples, try to understand them and then try to write it yourself. Just create new databases with minimal tables and layouts and experiment.
It seems like you are looking for what has been named Virtual Lists in the FM scene... Always handy in any solution. In general it works like this... You add a table with about a 1000 rows, the data displayed in the rows is pulled from a global variable. Each row always starts with the ID of the item you want to select. You can fill the global in several ways. Using ExecuteSQL is a pretty convenient one.
One nice example of it is built in this demo of selector connector file. Click the Orders and then on the pencil to get the list I mean. You can determine with a SQL query which fields you want to show.
Here is a similar implementation. The virtual list in on the left. You could put that in a popup window so a user can select or type to find the referral to choose.