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.

Portal and SelfJoin

Featured Replies

Hi guys,

I am wandering if it's possible to view the "many side" of the relationship in the portal without normalizing the file into two files.

What I mean is: I have a file called companies, which also has employees in it. I know this is not the right way to do things, but let's just say that's the situation.

There are several employees in each company. Is there a trick with selfjoin to view all the employees per each company in a portal?

Thank you

It depends on what your data structure looks like. Do you have a seperate record for each employee? If so, then you can do a selfjoin on the company ID or company field.

  • Author

Goldraven,

Yes, there is a separate record for each employee.

Usually, I would normalize this into two separate files (Company and Employee), but in this case I can't.

When I selfjoin on the CompanyID, only one employee (the one in this record) shows up, e.g. If I specify the portal to be 10 records long, employee "01" will show up 10 times.

CommentTest2.zip

Even though you've said you can't, I have to say that the best way to do this is to normalize wink.gif

That said, to do this properly, you need unique numerical IDs (preferably) or names for each company and each employee. Anytime you have a record for a specific company, it would have to have the correct ID.

Since you want to see multiple employees for single companies, the way you have the file set up now would require you to do the selfjoin on the company ID. That way the portal will find all the records in the DB where the company is the same as the record you are currently looking at. Then, within that portal, show the employee.. and this is important.. make sure you show the Employee field _from the selfjoin_ relationship, not from the "current file".

  • Author

raven,

I did exactly that last time, and was wandering why it's not working for me (I did that before with selfjoins).

Now I deleted my portal, and created a new identical one (without editing the relationship) and it worked this time.

Wierd...I think you scared my FM into submission.

Thanks

Tell it to behave or I'll give it the smack down wink.gif

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.