Jump to content
Sign in to follow this  
aislinn

Showing related fields from one portal to another

Recommended Posts

Hi there!

I have a couple of tables (Travels, Companies and Countries) that have a many-to-many relationship.

This means that in my Travel input form, I am using portals to add the visited Countries and Companies (1 portal for each).

Is it possible to list only the Companies related to the selected Countries in the respective portals?

Share this post


Link to post
Share on other sites

I'd love to help, but need more info on how the tables are related. You say you have many-to-many relationships. How did you resolve that? With join tables?

Share this post


Link to post
Share on other sites

Yes, I have join tables (TravelCompany and TravelCountry) that contain the ID-fields of each of the linked tables (Travel_ID, Company_ID, Country_ID).

For each of these relationships I have selected the option to create records via the relationships on both sides, and delete related records only on join table side.

Share this post


Link to post
Share on other sites

I should also specify that in each portal, I work with drop-down lists (CountryNames in CountryPortal and CompanyNames in CompanyPortal).

The aim is, after selecting the different countries that were visited, to show only the Companies based in the selected Countries in the Company drop-down in CompanyPortal.

This is only to create new relationships in the join tables based on existing records from the main tables. Completely new records are based on a script so there is no problem there.

Hope I'm making sense here...

Share this post


Link to post
Share on other sites

I don't see why you need the join table TravelCountry. Once you have selected the visited companies, the visited countries are obviously the countries of those companies - unless you have visited a country without visiting any company there.

If you only need to filter the value list of Companies, I would add a global field gCountryID to the Travels table and use it to link to a second occurrence of the Companies table. The field could be a checkbox. Then your value list can be based on related values only from Companies 2, starting from Travels.

(This is assuming that the relationship between Countries and Companies is one-to-many.)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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