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.

Relationship based on Field Name

Featured Replies

I have 2 tables in my file.

Table1 has fields like "Title", "Creator", "Type" and "Description".

Table2 has 2 fields, "fieldName" and "fieldDescription". The values in "fieldName" match the Field Names in Table1.

What I want to happen is when the cursor moves into a field in Table1, the description that goes along with that field is displayed in "Description". So, I want to look for the record in Table2 that has the name of the active field in Table1 and put the value in "fieldDescription" in Table1's "Description" field.

Why don't I just use the FieldComment() function? Because there is more than one line of text in the descriptions.

Sorry if this is a complete newbie question, but I can't seem to wrap my brain around it.

Thank you for any hints/suggestions you can give.

You can do this with a script if you use the Get(ActiveFieldName) function to set a global in Table 1, then have a relationship between Table1:gActiveFieldName and Table2:fieldName. You can then show the related fieldDescription on the layout.

Because the Get(ActiveFieldName) only evaluates correctly during scripts, you can't use it directly to create the relationship.

  • Author

I set a field in Table1 - gActiveFieldName as Text, Global Storage.

I create a script "setActiveFieldName" with one step "Set Field[table1::gActiveFieldName; Get ( ActiveFieldName)]

I run that script when I open the file (B)?)

I open up "File --> Define --> Database --> Relationships" and drag a line from 'gActiveFieldName" in Table1 to 'FieldName' in Table2.

On my layout in Table1, I put a field "::FieldDescription" from Table2.

I reopen my file.

I see nothing in 'gActiveFieldName" or "::FieldDescription" on my layout as I tab through the fields. Please forgive my obvious lack of FM skill and give me a few more hints. :-)

Thank you!

You would have to run the script (with your cursor in a field) everytime you want to see the related description.

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.