Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I know this is possible and simple, but for some reason I can't get it to work. I have two dbs, A and B. I have a key field in B that I would like to set via a script in A to create the relationship. Therefore the script in A says:

Run external script in B (which creates a new record)

Then it says to set the Keyfield in B with the value of the Keyfield in A.

The problem is that it doesn't work. Maybe this isn't possible or maybe I've made a mistake. Any thoughts?

Posted

quote:

Originally posted by skuli:

I know this is possible and simple, but for some reason I can't get it to work. I have two dbs, A and B. I have a key field in B that I would like to set via a script in A to create the relationship. Therefore the script in A says:

Run external script in B (which creates a new record)

Then it says to set the Keyfield in B with the value of the Keyfield in A.

The problem is that it doesn't work. Maybe this isn't possible or maybe I've made a mistake. Any thoughts?

It does not work because when you create the new record in B, it is not linked to A, so the relationship to that record is not valid. The best thing to do would be to set a global in A with the value of the ID, then create the record in B, then use a relationship from B to A via a constant and set the ID to the value of the global in A. Do this all from B.

You can also use the capability of relationships and portals to create new records simply by setting the value of a related field. Filemaker then sets the appropriate IDs automatically. However this is a bit tricker and you need to make sure that you do not already have a valid related record, or else you will simply overwrite existing information.

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