Jump to content

Portal and SelfJoin


bbaliner
 Share

This topic is 7143 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 7143 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.