I am trying to link two tables but have a relationship type for that link identified. For example:
If I have a Teams Module that I have created that is like the accounts module, and I want to link Contacts to the Teams as a many to many relationship, so a contact can be on multiple teams and of course, teams have multiple contacts.
The kicker is I want to identify for that link, what their role is on that team, such as Coach, Player and so on.
The goal is to not have to create a new contact/role for each person every time they are added to a team. I only want one John Doe contact in the database and one Jane Doe contact in the database, but when I assigned them to the team I want to specify the role they have.
I was considering creating a Roles Table, that would have the different types of roles (Coach, Adviser, Sponsor, Player…) and then creating relationships to do the linking.
To view it I would foresee having the teams listed, then you click on a team and to see the details, and one of the sub panels would be the Roles, which would list all the roles and show the contact information of the person assigned to that role for that team.
If anyone has any guidance to help me figure this out I greatly appreciate it.
Thank you pgr, I believe that is exactly what I am looking for!
I have been a php developer in the past, so I am getting to learn the structure of the code for SuiteCRM for some of the customization that we are trying to get to. Just having to try to remove the rust from my skills.
Those are good insights as well, I guess the only part I need to figure out (Other than the coding part which is pretty well documented in your first post) is how this changes if I want to use a dropdown list be the control/input method for the new relationship field.
In the walk through you posted they were using a date field. I would assume I need to create the dropdown and then do a linking to that dropdown to the field. So I assume the Metadata file they specify (ustom/metadata/fp_events_contactsMetaData.php) the type would be a varchar and specify the len like 30.
Then I would need to do a custom/metadata/SearchFields.php type file to do the linking between the dropdown and the actual field.