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

Script to add new record to related table


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

Recommended Posts

Posted

I have two related tables, one to many.

NAMES, made up of:

name

home_address

nameID

PLACES, made up of:

Place

nameID

The layout shows one Name and through a portal shows many Places.

How do I write a button script that adds a new record in PLACES and then inserts names:home_address in places:place and name:nameID into places:nameID

Thanks

Posted (edited)

How do I write a button script that adds a new record in PLACES and then inserts names:home_address in places:place and name:nameID into places:nameID

Try (from button on Names layout):P

Freeze Window

Set Variable [ $nameID ; Names::NameID ]

Go To Layout [ layout based upon Places ]

New Record/Request

Set Field [ Places::NameID ; $nameID ]

Set Field [ Places::place ; Names::home_address ]

Go To Layout [ Original Layout ]

Planting the Names::home_address into standard field in Places may not be necessary. I do not understand the relationship between the two tables nor your solution but the Places::Place field may not be necessary ... you can simply place the Names fields directly onto your Places layout. It is only necessary to plant as standard data if it is required for historical purpose, ie, the Names::home_address can change but you need to keep the Places::place the value it was at the time the record was created.

Edited by Guest
Changed sentence
  • Like 1

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