Record Roles
Seven20 includes the functionality to assign roles to records. These roles allow individual Contact records to be assigned to a record, and define the role that the Contact has on that record. For example, a Contact may be assigned to a Job record with the role of "Hiring Manager".
Supported objects
The record roles functionality is supported on the following objects:
- seven20__Job__c
- seven20__Job_Lead__c
- Custom Objects
To enable support for custom objects, a new lookup field needs to be created on the Roles (seven20__Role__c) object, pointing to the object roles are to be assigned to.
Follow the naming convention of "Object Name" for the lookup label and API name.
Setup
To start using record roles on a supported object, a Lightning Web Component needs to be added to the lightning page, which is called Role related list. As the name suggests, this presents a related list style component on the page, which displays the roles assigned to the record and allows easy management of them.
Once the component has been added to the page, it requires some design time attributes to be set before it can function correctly. These attributes are:
| Attribute | Type | Required | Description |
|---|---|---|---|
| Role relationship | Combobox | Yes | Allows you to search for, and select, a relationship to the Role object |
| Account lookup | Combobox | Yes | Allows you to search for, and select, a lookup field to the Account object, based on the lightning page's SObject type. This is used to quickly find relevant Contact records when adding new roles |
| Hide Mass Speculative CV Button | Checkbox | No | Hides the Mass Speculative CV action |
The Role relationship and Account lookup options default to the first relationship and lookup field on the object respectively.
Related list view
The lightning web component presents a table view of the roles assigned to the record, this has the look and feel of a standard related list. The columns in the table can be configured by creating a field set against the roles object, and then via a Seven20 Configuration metadata record with the developer name Role_Related_List_Fieldset.
Adding new roles
To add a new role to a record, click the New Role button on the lightning web component. This will open a modal window. The modal first presents a table of contacts related to the account from the Account Lookup field, these can be selected with the checkbox on the left hand side of the table. Additional Contacts can be added to the table by searching for them in the Add Additional Contact search input at the top of the modal, any Contact selected will be added to the table in the selected state. The columns in the table can be configured by creating a field set against the Contact object, and then via a Seven20 Configuration metadata record with the developer name New_role_table_fieldset.
After choosing the correct Contacts to add roles for, the Next button takes the user to a screen which shows all the selected contacts in a table view. Each row in the table has a dropdown which allows the user to select the role for that Contact, the options are drawn from the seven20__Role__c field. There is also a Remove Bin button on each row, which allows the user to remove the Contact from the list if they were added in error.
Creating a Hiring Manager role record does not auto-populate the seven20__Hiring_Manager__c field on seven20__Job__c and seven20__Job_Lead__c. Nor does setting that field value auto-create a new role record.
Related list actions
There are several actions which can be performed on the related list component, these are:
| Action | Requires Selected Roles | Description |
|---|---|---|
| New Role | No | See above |
| Edit Roles | No | Opens a modal, similar to the second screen of the New Role modal, which shows existing roles, allowing for the role to be changed or deleted |
| Mass Speculative CV | Yes | Redirects to the Mass Speculative CV page with the recipients set to the selected roles' Contacts. Upon completion, redirects to the previous page |
| Mass Email Roles | Yes | Opens a modal to send emails to the selected roles' contacts. Email templates can be used and need to be configured against the relevant SObject for each page on which the Roles related list is included. Related templates can be grouped using the email template folders configuration, by placing them in the folder assigned to Mass Email Role. |
Custom actions are not currently supported.