Related fields vs relationships --> listing all events linked to a module in an email


I have a practical module setup question because after reading all of the docs I could find, I am still not sure about the best way to achieve something that feels fairly simple to me.

I am setting up a system for a sports organization. I would like to manage a number of events and, for each of them, there is an outside contact who is in charge (not an employee of the organization).

I have created a module called assignment that contains information about the contact’s role in the events.

I have set up the following module relationships:

  • assignments <-- “many to one” --> contacts
  • assignments <-- “many to many” --> events

I have also created a workflow to confirm the assignment to the contact once it is approved. It works well.

However, I would like to list in the confirmation email all the events the contact is assigned to. I seem to find no way of doing this - even through calculated fields.

An option I can think of would be to create 10 relate fields in the assignment module (this is the max number of events for one contact) but it seems to be a fairly clumsy way of doing it:

  • I like the relationships because the panel views are invaluable to manage contacts / events / reports, so I don’t want to remove them
  • adding relate fields requires to provide the same information twice (events managed by the contact) so it will lead to unnecessary mistakes and a waste of time.

Am I missing something really obvious?

Thanks a lot in advance if you have pointers :slight_smile:

You probably just want to create a field inside the relationship, not create a full intermediate module. Creating a full module heavily complicates things, that’s why you’re getting additional problems.

If you search the forums for “fields in relationships” you’ll find some stuff, but I must warn you it’s a known pain point in SuiteCRM. It’s possible, but not from Studio, and it’s complicated to do from PHP.

(An example of a field in a relationship is in Opportunities module, enter a detail view, scroll down to the contacts subpanel and click the “edit” button)

Hi @pgr,

Thanks a lot for your reply, and for confirming that it is not necessarily easy.

I have looked at Opportunities as you suggested - and I assume that you are referring to the “role” field that appears for contacts. It is interesting indeed.

At the moment I am finding a workaround to my initial issue - the system will generate one email per managed event, which is not that much of a problem. It is still very interesting to use modules for the event subpanels and reporting possibilities - enormous help in managing the events.