Sorry, let me try to be more clear, or maybe even give a smaller example that is related.
This is a different database model, but similar. There are clients and staff. I am on the layout for a table that documents instances of service, when a staff person works with a client. In addition, each client has a service plan, which a staff person has helped create (possibly a different staff person, as multiple staff work with the same client).
The user picks a client from a dropdown of available clients. I would then like another field on this layout to immediately populate with the name of the staff who created the service plan (staff and client IDs for the service plan are stored in the service plan). To make it more complicated, each client has multiple service plans (like the course plans above), and each may be created by different staff. However, only one is active. In addition to pulling up the name of the staff person whose ID is in the service plan, I would like to also do some logic double checking that the service plan is active, and popping up a message if it is not.
I know I need to use scripting to do the message and probably the logic at the end. But even without that step, I am unsure how to take the jump from the selected client ID, to then do the logic to the effect (forgive me, I'm thinking in semi-SQL pseudocode)
Select LastNameFirstName from PERSON
Where PERSON.StaffID = ServicePlan.StaffID
and where ServicePlan.ClientID = Current Client ID
This pseudocode is missing the bit about finding the active service plan, but in any event, understanding even a piece of how this works in filemaker would be very helpful!