Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

script to make relation between two tables - Childsoldiers will be thankful

Featured Replies

  • Newbies

As I'm new in FM and this forum, I do have a question about a certain script.

In my DB I do have three tables:

"children", "sponsors" and "adoption".

The children in my DB have a status "free" or "occupied" and an ID.

My sponsors have an ID

In the table adoption I'd like to link a child to a sponsor.

I'd like to make a script that selects automatically a child that is "free", with the lowest "id". This value (child ID) should be placed in the tabled adoption.

Can anyone help me for this script?

Thanks

The scripting as such, is next to nothing a single line of Set Field[ and then a Commit Record step.

The tricky part is the relational bit and calc'field used as filter needs to be returning text, and the match field too.

List ( All_Adoptions::fk_child ) & "¶~"

To be on the safe side then substitute the Commit with yet another Set Field[ setting the former calc'field "UsedIDs" as now a global text field.

Take a look at the template attached!

--sd

Billede_1.jpg

childsoldiers.zip

  • Author
  • Newbies

The script included doesn't work I think ("Function missing") and I don't get this picture...

The script uses the List() command: check your version of FMP. Is it 8.0 or 8.5?

Sorry 'bout that; use ValuelistItems( instead! But Vaughan has a point here!!!!

http://www.filemaker.com/help/Functions%20Ref45.html

Which makes the cartesian relation redundant!

--sd

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.