AnsweredAssumed Answered

Portals to move (add or remove) linked files among a join table

Question asked by miw on May 6, 2015
Latest reply on May 7, 2015 by philmodjunk


Portals to move (add or remove) linked files among a join table


I am looking for a more elegant solution to adding or removing a record from a table to a related join table.  As per the image (Capture.png) attached, I have the following main tables:  Country and Mint.  I have a join table named CountryMint and an unaffiliated table named UnaffiliatedMint.  Multiple Countries can have multiple Mints in the CountryMint join table.  Currently, to add and create a record in the CountryMint join table, in the Country layout I have a one-line portal for CountryMint with a pop-up menu field for CountryMintID with pop-up menu values being pulled from the UnaffiliatedMint table.  When I select a unaffiliated Mint in the pop-up field, the new CountryMint record is created without a problem.  But, it is not too elegant a solution with the one-line portal and pop-up field. 

What I would like to do is have a multi-line portal which shows ALL remaining UnaffiliatedMints for the Country and select from that portal an Unaffilitated Mint to create the record in the CountryMint join table.  My first problem is figuring out the table to "show related records from" for the portal and the proper fields in the portal (if the field source is different from the "show related records from" table for the portal itself).  Then, for a button on the selected portal row, the script to add the selected Mint from the portal to make the CountryMint join record.

I have had success in such design if a Mint can only be assigned to one Country (ie once a Mint is assigned to a Country it no longer is on the UnaffiliatedMint list for selection by any other Country).  But what I am trying to accomplish is a portal whereby any Country can be assigned any Mint that has not already been affiliated to it and whereby Mints can be assigned to any and multiple Countries.