2

i tried to look for an answer but im pretty confused with what i found..
I'm trying to create a many to many relationship like in SQL..

for example:
lets say i want to create a custom 'Event'(a field set), so i make some fields(name,date,location etc..) BUT now i want to make a custom 'Team'(field set) which has an 'events' field that contains the id's/names of this team events.

thanks in advance!

EDIT
okay let me try with a diffrent example: im making a managment system for a soccer team. so lets say i make a 'Court'(field set) with fields like name,address etc.. and now i want to make a 'Team'(fieldset) which contains all the diffrent Court's this 'Team' has.. is it possible to link many 'Court' records to a specific team? and each 'Court' has its related 'Team's ? i hope i made it more clear..

  • 1
    can you try and flesh this out more. since civicrm already has Events what is a scenario for your 'event (field set)'? – petednz - fuzion Dec 22 '15 at 19:06
  • okay let me try with a diffrent example: im making a managment system for a soccer team. so lets say i make a 'Court'(field set) with fields like name,address etc.. and now i want to make a 'Team'(fieldset) which contains all the diffrent Court's this 'Team' has.. is it possible to link many 'Court' records to a specific team? and each 'Court' has its related 'Team's ? i hope i made it more clear.. – nadavshemesh Dec 24 '15 at 10:11
1

I think, if I'm reading your question correctly, that what you want to do does not require anything custom. I would do it this way:

  1. Create an event in CiviEvent. This will have the fields name, date, location, etc already available for you to fill.
  2. Make this event a certain "type." The built-in options are things such as workshop, meeting, and class, but you can add a type called "team."
  3. All the events of type "team" are easily searchable and viewable.

Is this what you were going for? If not, please describe in more detail what it is you are trying to do.

-1

I'm guessing that "Field-Set" is the CiviCRM terminology for table?

You need to create 3 Field-Sets.

  1. The first field-set for Court, it will have an id and the fields that describe the Court.

  2. The second field-set for Team, it will have an id and the fields that describe the Team.

  3. The third field-set for the connection between them, it will have an id as all field sets have and you will add fields for the court-id and the team-id.

If you want to show in the Team screen a list of the Courts belonging to the Team, use a small table view in that screen showing the result of the query where you join the tables using the 3rd table and similarly for the other view for the Court screen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.