When looking at the detail view of a company i have a collection component showing all the contactpersons that are linked to that specific company. I have the option to create new contactpersons through the action, but how can i achieve the functionality of adding an existing contactperson to the company?
That depends. Do you have contacts listed in the company row, or do you have companies listed in the contacts row? How is your relation between the two configured?
Would you add contacts to a company when viewing the company, or when viewing the contact?
My thought is to have a multi choice component in the company edit screen to select multiple contacts, or have a multi choice component in the contact edit screen to select multiple companies. Ultimately get a comma delimited list of contacts or companies that you can split into an array using a Split Text column, and use that with the relation.
Either way, just make sure you are storing and using RowID’s instead of names to use when building the relation. Otherwise you risk breaking the relation if you ever change the name of a company or contact.
Preffered solution would to have an action button on that collection that opened a modal/popup in which i could scroll and search through our contactperson table and select/add contacts to that company