Jump to content

Creating Related Records


25120221

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

Recommended Posts

  • Newbies

can anyone help??? I'm trying to get my Master DB to create related records every time a new record is created in the Master.

I've followed the help procedure, the user's guide and experimented every way i can, but it ain't working.

Student DB

(many fields)

ID (number, auto enter serial, indexed)

Surname

Photo DB

ID

Surname

Relationships

Student DB related to Photo DB

ID::ID

Any ideas?

Link to comment
Share on other sites

Why are you doing this? Do you expect there to be multiple pictures for each student?

This will likely have to be done by script. THe script will create a new record in the Student database. Then, it can populate a row in a portal. That will automatically create a newrecord (one or more than one) in the Photo database.

Create the relationship between the files and set it to Allow Creation of Related Records. THen as part of the script, send the cursor to the last row of the portal and automatically insert something such as the current date or the current user name. That will automatically create a new related record complete with the proper foreign key.

HTH

Old Advance Man

Link to comment
Share on other sites

hi, if get your problem, you need to create a related record.

the basic principle is:

in the relation, chek the box "allow creation of new records"

now, in the script, when you use "set field", and choose a field of the other file, and put some thing on it, filemaker will create a new related record (if it does not exist)

Now, if htere is allready a related field in the other file, it is a little trikii:

what i do is to create an aditional field in both files (like RELATION) then, i relate the 2 files by that field. then before creating a new record in the file two from the file one, i set the field relation to some value, and then set the same field to the same value in the file two (throught the reltionship), in that way there is a new "unique" related record in the file two, then i set all the others fields with the info i need, and then set the field relation in the field two to empty or to anther value. in that way you can create as much new records as you want.

hope it help, and sorry for the confusion, but I am in a hurry.

------------------------------------------------------------------------

"never say to woman that she look like your mother, NEVER"

Link to comment
Share on other sites

This topic is 8213 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.