Some thoughts:
1. I understand you are not familiar with FileMaker. I suggest you take
the time to play with it, look at the documentation, create some
databases of your own to see how it works. You may find it easy to learn
about, and easy to use to do various complex things.
2. I also understand the solution was built by someone else. You
inherited it. You may not fully understand how it works, or how the
person who developed it intended it to work. You need to study it enough
to figure that out.
3. I am using the term Table in this discussion. Whether the tables are
in the same or different database files does not really matter. The
developer would create a relationship diagram in one or the other
database file, or perhaps in a third file if desired. Table Occurrences
in the relationship digram would be based on tables in one or another of
the data files.
4. Usual good practice is to have in each table a field that uniquely
identifies each record. Normally this is a number field, set up as an
automatically generated serial number, not editable by the user, and
validated to be not empty and unique. Those characteristics are set up
in the field definition. This is the primary key field for that table.
5. Another table related to the first table would normally contain a
number field to hold a value for the relationship to the first table.
The value would normally be set to hold the value of the related Primary
Key field. This field is known as a foreign key field, as it holds a
value derived from a "foreign" table to make the relationship to that
foreign table.
6. Many developers use field names as follows for these important fields:
__kp[NameID] for the primary key field of the table, where [Name] might
be the name of the table, or some other suitable name. kp identifies it
as the primary key field of the table. The double underscore __ makes it
sort first in a name sort of the fields.
_kf[NameID] for a foreign key field for relationship to another table.
[Name] might be the name of the other table, or some other suitable
name. kf signifies it is a foreign key, that is, intended to hold the
value of the primary key from the "foreign" table to create the
relationship. The single underscore _ makes it sort ahead of all other
non-key fields but after the primary key field in the list of fields
when sorted by name.
7. In the relationship diagram, the two tables (call them A and B for
the sake of this discussion) would be related as follows:
A::__kpAID = B::_kfAID
The notation A::[field name] is customary in the literature. It
signifies a field of table A that has the name [field name], in this
case __kpAID
8. Now you need a mechanism to assign the appropriate value to
B::_kfTAID when assigning a record in B to be related to a record in A.
There are basically two methods of doing this:
a. Allow creation of a record in table B via the relationship to A. Use
a portal to B in a layout of A, and create a record in B by way of that
portal. Allowing creation of records in B via the relationship is a
matter of defining the tables and relationships in the relationship
diagram. Now when you create a record in B via the relationship, the
value A::__kpAID is automatically assigned to B::_kfAID
b. Use a script to create a record in B. The script would store the
value of A::__kpAID in a script parameter or script variable, go to a
layout of B, create a new record, and assign the stored value of
A::__kpAID to B::_kfAID.
9. Normally, table B would not contain any data from Table A except the
value of the relationship key field. Once the relationship is
established, other data from Table A can be displayed in a layout of
Table B, and vice-versa, and data from the related tables can be used in
calculations etc. Then, whenever data is changed in Table A, the changed
data will automatically show up everywhere is used.
10. Sometimes there are good reasons to store data from one table in
another table. An example would be price data in the line item of an
invoice. Prices of items may change from time to time. New invoices
should pick up the new price, but the old price should be left unchanged
in old invoices.
11. There are basically two methods of getting data from one table to be
stored in another table. Say the two tables have the field "Price." We
want to store the value of Price taken from Table A in the Price field
of Table B. Two different methods:
a. Field definition based on the relationship:
B::Price defined to be calculated from A::Price, the formula being
B::Price = A::Price
b. By script. The Script stores the value of A::Price as a script
parameter or script variable. The script then goes to a layout of Table
B, finds the appropriate record in Table B, and assigns the stored value
of A::Price to the field B::Price.
You would normally include this in the script that creates the record in
Table B, so that the script stores both the value of A::__kpAID and the
value of A::Price, and then assigns those values to B::_kfAID and
B::Price respectively in the process of creating the new related record
in Table B.
On the other hand, if you want to assign the value of Price later, you
would need to incorporate script steps to Find records in B that contain
the appropriate value of B::_kfAID. However, this can get into trouble
if you have more than one record in B that has that value of of
B::_kfAID. For example, you might have multiple invoice line items
related to the one price list. You need a mechanism in the script to
find the record in B that you want to change, and not the others. For
this reason it is normally better to assign the value of Price when you
create the new record in B.
Hope this helps.