Jump to content
Server Maintenance This Week. ×

Relationship Basics Question


schotja

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

Recommended Posts

Struggling with new learning curve with version 7.

I have a complex file with tons of fields and scripts.

I would like to populate a related file with data from just 2 of the fields.

When a new record is created in CmplxFile1, i want a new record created in simplefile2, automatically with the exact data from the two fields populating the records in simplefile2.

The new fm7 table is confusing me and my simple file relationships aren't working!

Suggestions?

Link to comment
Share on other sites

Crash course one whole night educated me but I'd love for some tips on copying records from related files tips or cool tricks.

Is there somewhere you guys go because i'm not seeing any in this forum under that topic that are really relavent?

Link to comment
Share on other sites

It's unclear whether you want to be creating shadow records only for *newly created* records (as the end of your post suggests), or whether you want to create shadow records for all your existing records.

For your existing records, just go to simplefile2 and do an *import* and line up the desired fields from CmplxFile1 so that they'll match with your two desired fields.

To know how to handle the creation of new records, I'm inclined to ask about the *purpose* of these simple-db "shadow records". For example, I have a separate file with pictures, and I want it separate from my people data file so that I'm not hogging up megabytes in my frequent back-ups. But in a case like that, I don't really *need* to have a shadow record in the pix table *until and unless* there actually is a picture. So, I wait until there's a picture, and I just have the related picture field included on my main db's record for each person. I set up the relational link to enable creation of related records in the pix table (which is in a separate file, though it could be in the same file under FM7). So, as soon as I paste into this empty container field in my "people" layout, viola! a new pix table record is created, and it sets up the new record with the right match field(s) automatically.

Generally, you won't want a simpler database which has simply a *subset* of the larger db's fields. You'll want it to track some additional dimension. Then, you can make records auto-populate themselves with the relational match key whenever that new dimension of data becomes relevant.

Say more if this is unclear or irrelevant to your concerns...

Link to comment
Share on other sites

Hi Schotja

I am fairly new to FM7 myself but i have done what you want to do.

"When a new record is created in CmplxFile1, i want a new record created in simplefile2, automatically with the exact data from the two fields populating the records in simplefile2."

in the relationship box, choose CmplxFile1 on the left side and Simplefile2 on the right side and check the box on the right side that states "Create New record in related file."

Write a script and use the set field command to populate the two fields that you want.

I hope this helps and i think i got the relationships right, if not, just reverse them.

Lionel

Link to comment
Share on other sites

This topic is 7302 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
×
×
  • Create New...

Important Information

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