Enabling Contact Roles for Invoice Distribution
← Setting Up Invoice Distribution
You can use contact roles to pre-populate contact and address fields when executing an invoice run. JustOn Billing & Invoice Management supports contact roles as defined using the custom picklist field JustOn Contact Role
on the Contact object or on the Account Contact Relationship object.
Depending on your business requirements or use cases, proceed as follows:
- For users with a JustOn license, you add the managed field
JustOn Contact Role
(API nameONB2__ContactRole__c
) to the page layout of the Contact object. -
For users without a JustOn license, the managed Contact field
ONB2__ContactRole__c
is not visible. If you still must support contact roles on contacts, you create the custom fieldJustOnContactRole
on the Contact object, which replicates the behavior ofONB2__ContactRole__c
but is available for other Salesforce users.Once the custom field is defined, it takes precedence over the managed field.
-
If you need the contact role functionality on account–contact relationships, you create the custom field
JustOnContactRole
on the Account Contact Relationship object.
Once enabled, users can define contact roles for the invoice distribution use cases.
JustOn Contact Role priority
- If both
JustOn Contact Role
on the account–contact relationship andJustOn Contact Role
on the contact are set, the role defined on the account–contact relationship (irrespective of whether it is a primary or secondary relation) has priority over the role defined on the contact. - If
JustOn Contact Role
is set both on a direct and an indirect account–contact relationship, the role defined on the direct account–contact relationship (primary relation) has priority over the role defined on the indirect account–contact relationship. -
JustOn Billing & Invoice Management considers JustOn contact roles defined on primary contacts (related via a direct account–contact relationship) only.
If you need a JustOn contact role on a secondary contact (related via an indirect account–contact relationship), you must define it on the corresponding ACR record.
-
Salesforce allows time limitations and an explicit
Active
status for account–contact relationships. These settings, however, do not have influence on the priority of the assigned JustOn contact roles. If an account–contact relationship is valid on a given date, JustOn Billing & Invoice Management will consider the assigned contact role.You must make sure to not assign two or more contacts with the same role to an account. If this is the case, the system randomly picks one of them, which may produce unwanted results.
-
Contact role settings on the account–contact relationship (ACR) and on the contact can complement each other, as long as they are not in conflict.
- For compatibility reasons, JustOn Billing & Invoice Management still supports existing Salesforce Classic Account Contact Roles. If available, they take general precedence over the values set in the
JustOn Contact Role
fields on the contact or the account–contact relationship.
To keep control simple, use JustOn contact roles either on contacts or on account-contact relationships only. If you decide to use account-contact relationships, JustOn recommends to use JustOn contact roles on account-contact relationships for more flexibility.
The examples in JustOn Contact Role Priority illustrate the behavior.
Using Managed Contact Role Field on Contact
To add the managed field JustOn Contact Role
(API name ONB2__ContactRole__c
) to the page layout of the Contact object:
- Click to enter Setup, then navigate to the object management settings of the Contact object.
- Click Page Layouts.
- In the Contact Layout row, click Edit.
- Drag the
JustOn Contact Role
field to the page layout. -
Click Save.
For help about modifying page layouts, see Managing Pages.
Creating Custom Contact Role Field on Contact
To create the custom field JustOnContactRole
on the Contact object to replicate the behavior of ONB2__ContactRole__c
:
-
Click to enter Setup, then navigate to the fields list of the Contact object.
Open the field configuration for
JustOn Contact Role
in a new browser window or tab for later reference. -
Create the following new field.
Label API Name Data Type Values JustOn Contact Role JustOnContactRole
Picklist (Multi-Select) Copy all picklist entries from JustOn Contact Role
that are needed for your org's uses cases.
Make sure to use the same API names for the picklist entries.For help about creating fields, see Managing Object Fields in the JustOn Documentation or Create Custom Fields in the Salesforce Help.
-
Allow the relevant users access to the new field either by adding it to their assigned profiles or permission sets.
For details, see Set Field Permissions in Permission Sets and Profiles in the Salesforce Help.
-
Allowlist the new field to make it accessible for database queries.
To this end, create the new Field Whitelist record
JustOnContactRole__c
. -
Add the new picklist field (API name
JustOnContactRole
) to the Contact layout.Remove, if necessary, the managed field (API name
ONB2__ContactRole__c
) from the layout.For help about modifying page layouts, see Managing Pages or Page Layouts in the Salesforce Help.
Creating Contact Role Field on Account Contact Relationship
Salesforce allows associating one contact to multiple accounts through the Account Contact Relationship object. For details and configuration instructions, see
- Contacts to Multiple Accounts in the Salesforce Help
-
Set Up Contacts to Multiple Accounts
JustOn recommends to add both the Related Accounts related list to the relevant Contact page layouts and the Related Contacts related list to the relevant Account page layouts.
Once set up accordingly, you can enable JustOn contact roles on account–contact relationships. To this end, you create the custom field JustOnContactRole
on the Account Contact Relationship object:
-
Click to enter Setup, then navigate to the fields list of the Account Contact Relationship object.
Open the field configuration for
JustOn Contact Role
on the Contact object in a new browser window or tab for later reference. -
Create the following new field.
Label API Name Data Type Values JustOn Contact Role JustOnContactRole
Picklist (Multi-Select) Copy all picklist entries from JustOn Contact Role
on the Contact object that are needed for your org's uses cases.
Make sure to use the same API names for the picklist entries.For help about creating fields, see Managing Object Fields in the JustOn Documentation or Create Custom Fields in the Salesforce Help.
-
Allow the relevant users access to the new field either by adding it to their assigned profiles or permission sets.
For details, see Set Field Permissions in Permission Sets and Profiles in the Salesforce Help.
-
Allowlist the new field to make it accessible for database queries.
To this end, create the new Field Whitelist record
JustOnContactRole__c
.If you have already allowlisted the custom field
JustOnContactRole
as created on the Contact object, do not create a second record. A Field Whitelist record allowlists a field, irrespective of its object. -
Add the new picklist field (API name
JustOnContactRole
) to the Account Contact Relationship layout.For help about modifying page layouts, see Managing Pages or Page Layouts in the Salesforce Help.
Enabling Contact Role Criterion
You can make use of contact role criteria in order to add another selectivity level. They are additional conditions for controlling how JustOn Billing & Invoice Management applies contact roles.
Think of a large organization that has different invoice recipients, depending on specific characteristics of the purchased products or services. With the same contact role set on multiple contacts of this account, JustOn Billing & Invoice Management would produce random results. However, applying criteria that cover the specific characteristics – in addition to the contact roles –, you can still control the targeted assignment of the correct contact to a given invoice.
Note
Before proceeding to technically enabling the contact role criterion feature, determine the criteria to be applied and their context – that is, you decide which conditions of your invoice source data or your accounts are to control how JustOn Billing & Invoice Management applies contact roles.
After you have determined the contact role criteria, proceed as follows to enable the functionality:
-
Create the field
ON_ContactRoleCriterion
on the relevant invoice source object or the account.API Name Data Type Notes ON_ContactRoleCriterion Text (255)
Formula (Text)Use formula logic, the ON field mechanism, Salesforce flows or other automation tools to have the intended criterion set on certain conditions. -
Add the applicable criterion/use case combinations to the
JustOn Contact Role
field.Depending on your requirements, this can be the managed field or the custom field on the contact or, if set up and used, the custom field on the account-contact relationship.
For details, see Modifying Picklist Values.