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.

Dynamic relationship creation...

Featured Replies

  • Newbies

Databases:

Account DB

Site DB

Contact DB

Relationships:

Account DB

Site DB A.Accountid = S.Accountid

Contact DB A.Accountid = C.Accountid

Site DB

Account DB S.Account_ID = A.Account_ID

Site DB S.Account_ID = S.Account_ID

Contact DB S.Site_ID = C.Site_ID

Contact DB

Account DB C.Account_ID = A.Account_ID

Site DB C.Site_ID = S.Site_ID

Contact DB C.Site_ID = C.Site_ID

I can add a new site to an account and a new contact to a site, but I have no relationship when it comes to creating a new contact for a new site. Is there any way to pass variables from on DB to an unrealted one, or any other way to create the relationship on the fly to the site and account?

Can you confirm what version of FM you're using, please. I've found many people haven't updated, and it says you're in FM6 Dev.

If you are in FM6, you can relate all your files using a Constant. That is create a calc field in each table that equals 1. Then a relationship between each file where constant=constant.

Store values that you wish to pass from file to file in global fields.

Edited by Guest

  • Author
  • Newbies

Yes, unfortunately I am still stuck on FM6.

What you described seems to make sense, but I think the setup of this application is flawed. Each database contains it's own related layouts with portals into the other DBs. Since I can't say to go to an external layout directly, I am saying to go to related record (contacts related to other contacts by like site_id) from the site and then execute an external script to go to the layout and create a new record. Problem is that since that are no contacts already for this new site, it seems to just go to some random site and add the contact there.

Edited by Guest

Umm, "each database contains its own related layouts.." sounds like a normal FM6 setup. By database, you mean FM file.

So, you're in an Account and want to add a site. Then you notice it doesn't exist. So you need to create the new site. Then you want to add contacts, but they don't yet exist. Is that the scenario?

  • Author
  • Newbies

Yes, because I am using an "other contacts" relationship to the site, and their aren't any for a new site, goes to some random site instead.

I think if I do what you said with the calc fields relationship, that I can populate (create the relationship) by populating the contact record fields with the globals that I initialize while on the site record.

Exactly. It's a bit of interface tunneling, and carrying along the IDs that you need.

  • Author
  • Newbies

It works! I really appreciate your help.

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.