Overview
Consider the situation where a subgrid of contacts needs to be placed on the Appointments activity form. This would be an N:N relationship between the Appointment and Contact entities. Referring to Figure 1, it’s not possible to create such a relationship.
To meet this requirement, one option is to use a Multiselect lookup control. (I found it in the Field Service managed solution.) Referring to Figure 2, the Contact(s) field is a multiselect lookup control. It works just like a normal lookup and allows multiple contacts to be selected.
The control is defined as a text field (which we’ll go through below) and it stores records as JSON. See below
[{"id":"90664585-c154-ed11-9562-002248183202","entityType":"contact","name":"John Smith"},
{"id":"03c551ad-c254-ed11-9562-002248183202","entityType":"contact","name":"Jane Doe"}]
or
[{"_etn":"contact","_id":"90664585-c154-ed11-9562-002248183202","_name":"John Smith"},
{"_etn":"contact","_id":"03c551ad-c254-ed11-9562-002248183202","_name":"Jane Doe"}]
Setup
1.) Create a text field and set it to the maximum character count of 4000.
2.) Add the component ‘Multiselect Lookup Control’
3.) Determine the id of the ‘All Active Contact’ view to be used
4.) Set the control to lookup the contact entity and ‘All Active Contact’ view