On event we have the ability to add multiple contact or user object records using the eventRelation object in the form of a related list.
I wish to be able to display a table that shows all of the contacts related to the event in a table, and be able to display the contact name, associated account, and various account fields.
I’ve tried to create a model to handle this, but it doesn’t seem to be pulling through the correct records…any ideas?
Below is an image of how i’d like it to look.
Yup. The RelationId is a polymorphic field. You won’t be able to get fields from Contact, Lead or User using it without the use of a formula field for each field you’d like data on. The premise works on creating 3 support models that have all your attendees. Contact, Lead and User. Then you can use modellookup formula to get the fields you want into your EventRelation model.
Support formula of type text for prefix:
Example on UI only formula field for First Name:
Rinse and repeat for the remaining fields.
Thanks very much, probably being a tad thick because it’s Friday, but do the models containing contacts need to be eventrelation records, if you know what I mean? And then what condition do i need to have from my “Contacts” model to eventrelation model?
You will use the Contact, Lead and User object models with conditions like the following;
Id in EventRelationModel.RelationId
Make sure you place these models after EventRelationModel, otherwise the conditions won’t work.