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.

Self relationship & portal

Featured Replies

Hey All,

Does anybody know a way to remove the current record (i.e. Dick) from the portal when using a self relationship (so we only see Jane and Spot in the portal)?

quote:

Originally posted by skuli:

Hey All,

Does anybody know a way to remove the current record (i.e. Dick) from the portal when using a self relationship (so we only see Jane and Spot in the portal)?

Use a calculated key to do the join.

Assuming that the "self-relationship" is something like "FamilyID", then you could set either a global or an unstored calc (lets call it CurrentID) to the PrimaryID of the record. This establishes what the current record is.

Now setup a cFamilyID = if ( PrimaryID = CurrentID, "", FamilyID ).

Finally setup your relationship as FamilyID::cFamilyID. This setup causes cFamilyID to only be valid if it is not the current record.

Of course there are hundreds of other ways to do this as well, in addition to many varations on this theme. It all depends upon your EXACT needs and style.

  • Author

Thanks, but I'm not sure I understand everything you are saying. Let me explain the situation exactly so we can at least talk apples to apples. I have a names db and within that db is a portal with a self joining relationship of a unique company key. The portal then displays other people who work for this company. What I don't want to see is the persons name of the current record within the portal.

What I'm not clear about is setting the global field. Each record in the db has a unique ID (PKey). So therefore each person has a unique ID and each company has a unique ID.

I don't understand what this is:

cFamilyID = if ( PrimaryID = CurrentID, "", FamilyID ) and it seems to me that if the portal relationship is set to see if the current record ID is equal to the current person, then nobody would show up. Where have I gone wrong?

quote:

Originally posted by skuli:

Thanks, but I'm not sure I understand everything you are saying. Let me explain the situation exactly so we can at least talk apples to apples. I have a names db and within that db is a portal with a self joining relationship of a unique company key. The portal then displays other people who work for this company. What I don't want to see is the persons name of the current record within the portal.

What I'm not clear about is setting the global field. Each record in the db has a unique ID (PKey). So therefore each person has a unique ID and each company has a unique ID.

I don't understand what this is:

cFamilyID = if ( PrimaryID = CurrentID, "", FamilyID ) and it seems to me that if the portal relationship is set to see if the current record ID is equal to the current person, then nobody would show up. Where have I gone wrong?

You have a PrimaryID and a CompanyID, not knowing this, I called it a FamilyID. Everyone who works for the same company should have the same CompanyID, but everyone should also have a unique PrimaryID.

What you need to do is to setup a way to know "which record is the current record". Store that value in the CurrentID field. So that cCompanyID = if ( PrimaryID = CurrentID, "", CompanyID ).

Again setup your relationship as CompanyID::cCompanyID.

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.