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.

Setting value list foreign key via relationship

Featured Replies

  • Newbies

I've read many threads on related topics, but none seem to quite match what I'm struggling to do:

I have two tables, person and account, joined by a relationship of person:account_id to account:id. The account table also has a name field, and I've defined a value list 'All Accounts' that looks up all account:name values.

Users need to be able to select from the entire list of accounts when entering a new person record, and be able to enter a new account in that field if necessary. The system should enter the account:id value (auto-created for new account records) into the person:account_id field when an account:name value is selected from the accounts value list.

The relationship works fine for displaying the account name for imported person records (where person:account_id has been accurately inserted).

The problem is that when entering a new person record, selecting a value for account:name (via a related field) creates a new record in the account table. The ID for that record (account:id) is inserted in the field person:account_id. When an existing account name is selected from the list, a new account record should not be created.

I need to figure out how to insert the existing account:id value into person:account_id when the user selects the account:name value from the list, rather than have a new account record created. I also need users to be able to enter new account records from the same list field if the account to be entered is not already in the list.

This will be deployed using FM Instant Web Publishing, so I would appreciate any tips required to make a solution for the above challenge work with that as well.

Thanks!

Dave

Did you read all about functionality of "Instant Web Publishing"? Search all forums. Are you sure, that it will work for you?

  • Author
  • Newbies

>Did you read all about functionality of "Instant Web Publishing"? Search all forums. Are you sure, that it will work for you?

I've searched the forums and don't see any specific caveats about IWP. If it's limited in terms of performance, that's OK - this is just a prototype application. If it can't do what I've described in my original post, that would be a problem and I'd like to know about it.

Whether I use IWP or not, I would like to find out how to setup the value list / relationship functionality described in my first post above.

Thanks,

Dave

Not sure I fully understood what you were looking for here....

If you're entering record through a relationship set to "allow creation of related records", you'll always create related records with it.

If the record already exists, and you want to retrieve an ID, us a lookup.

If you were to proceed a new entry, use a global field and a script.

Please be more specific...

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.