1. By "clone" I hope you don't mean you have duplicated the Company table. If so, don't. A separate TO (Table Occurrence) of the same table is all you need.

What you are actually trying to do is not entirely clear, at least to me. I assume you are on some activity layout to which you want to link a specific company. In that case

2. I assume the portal is working for you. To select a specific company from the portal you need a button contained entirely within a portal row to run the script, so that it references the row it is part of. The script itself needs to:

– use Set Variable to capture the kp_Company from that portal row

– close the popover

– use Set Field to insert this value into the relevant foreign key field (I assume you already have an active record before activating the popover from your Select button).