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.

Basic Relationship problemsolution where

Featured Replies

  • Newbies

Apologies for a noddy question, but I just can't find an answer to this anywhere.

I am struggling to get a working where I have a one to many relationship, and want to step through all the related records.

Imagine my "main" database that has a field called matchfield which is always "1".

And I have a related database that has two fields, lets say "data" and "matchfield".

"data" has records A, B, C, D, E, F....

"matchfield" is always 1

I want a layout based on the main database, and I want a script that will sequentially give me all the values in the related database.

So I define a relationship

main database:matchfield = related database:matchfield

But now, how do I get each related record in turn? Whnat I have tried is

go to layout belonging to related database

go to first record

loop

got to layout belonging to main record

do something with field related database:data

got to layout belonging to related database

got to next record, exit on last

end loop

But this always returns the *first* record from the related database.

What am I doing wrong?

Many thanks for any help.

First of all, a constant match field is superfluous in version 7; you can create a relationship using the X operator to relate each record to all others.

Secondly, you can create a value list of the related field and sort it by the related serial (assuming your serial numbers are increasing in order), then create an unstored text calculation in the main table of

Substitute( ValueListItems( Get(FileName); "yourValueList" ); ¶; ", " )

for a comma-delimited list of the related field's values in creation order.

FYI: relationship::field only refers to the first related record's field value, which is probably why your script was not working as desired.

Hi Luke,

Maybe you can create a layout with main data and put on portal which displays data (that you want to modify) from related records. Then you create a script with GoToPortalRow script step and then in loop modify all of them.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.