Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

When creating a new document in a related file with a one to many relationship how can I automatically enter the Customer ID number that links the two.

Right now, I'm copying and pasting this number using a script. I've got to believe there's a better way.

Thanks,

Kelly

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

Posted

If the relationship is set to use this id field then, when you create a new record in a portal it will automatically add the id for you, because that is how it relates the information.

If you are not using a portal, then you will have to script it to add the id field.

The database will not know that when you create a new record in the second database which record it should relate to.

HTH

Posted

Hi Andy,

Thanks for getting back to me. The reason that I didn't consider a portal is because the informationI need to present in this portal is not a single row but instead about 3 rows and almost takes up a large portion of a 640 x 480 screen.

Perhaps I need to give this portl thing more consideration. If YOU were going to set this up with three FM files, Customer, Publication and Options how would you do it?

Customers ---> Publications via a portal

Publications ---> Options via a portal

Is this right? Please advise. Thanks again.

- Kelly

Posted

Exactly.

You'll notice that there are two threads here talking about the same thing; that can get kind of confusing. From now on, let's try to keep single ideas in a single thread.

Posted

If I was doing this by way of a script, i would have a global field in the related file and set this first.

To do this you need a constant field auto enter data 1 in each database and then a relationship based on the constant. then you can script this.

First write the script in the related database.

Script name - New record

New Record Request

Set field [CustomerID] "Global field"

Set Field (Constantrel::Global field) , "Customer ID"

Perform Script [subscript,external] "New Record.

If you do it by way of a portal, just set allow creation of related records and it does this for you.

HTH

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