July 13, 200124 yr 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?
July 13, 200124 yr 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.
Create an account or sign in to comment