-
Notifications
You must be signed in to change notification settings - Fork 19
The Affiliation Key
The Affiliation Key fields on both the Interactions and Affiliations objects as well as the Affiliation: Update Upsert Key workflow rule work together to determine when a new Affiliation is created or an existing Affiliation is updated. The Affiliation Key and the corresponding workflow rule can also be customized to better suit your business practices.
For a more technical explanation of how the Interaction’s code uses Affiliation Keys, see “Affiliation Creation” and “Affiliation Update” in the Technical Implementation Guide.
On the Interactions object, there is a formula field called Affiliation Key. There is also a workflow rule and field update that sets the Upsert Key field on the Affiliations object. The Affiliation Key formula field along with the workflow rule allow the Interactions Processor to determine whether to create new Affiliations or edit existing Affiliations.
Out-of-the-box, a new Affiliation is created for each Contact/Account combination. This means that if a Contact has an Affiliation with a Status of Current for a school and an Interaction is logged for the same school with a different Status (e.g. Former), the existing Affiliation will be updated and a new Affiliation will not be created.
When an Affiliation is created or edited, the “Affiliation: Update Upsert Key” workflow rule runs that sets the Upsert Key field on the Affiliations object to the Contact’s ID plus the Account’s ID that it is associated with the Affiliation.
This is the formula used for the field update:
CASESAFEID(hed__Contact__r.Id)+"."+ CASESAFEID(hed__Account__r.ID)
The delivered Affiliation Key formula on Interactions is this:
Formula: IF(ISBLANK(Affiliated_Account__c), "", "."+CASESAFEID(Affiliated_Account__r.Id))
If there is an Affiliated Account specified on an Interaction, this formula returns the value of the Affiliated Account’s 18-digit ID. The Interaction Processor then prepends Contact.Id once it finds or creates a Contact. If the Affiliation Key field on the Interaction matches the Upsert Key on an existing Affiliation, the Interaction Processor will update the matched Affiliation. If the fields do not match, a new Affiliation record will be created.
You may want to update how Affiliations are matched to better fit your business processes. For example, you may want to create separate Affiliations for a Contact/Account combination if the Contact’s Role changes (e.g. Student vs. Advisor).
To make this change, you need to:
-
Update the Affiliation Key formula field on Interactions by appending Role (or another Affiliation field, depending on your business process)
IF(ISBLANK(Affiliated_Account__c), "", "."+CASESAFEID(Affiliated_Account__r.Id) +"."+(Affiliation_Role__c) )
-
Update the Upsert Key: Set to Contact.Account field update by appending Role (or another Affiliation field)
CASESAFEID(hed__Contact__r.Id)+"."+ CASESAFEID(hed__Account__r.ID) +”."+(hed__Role__c)
-
Click Activate to turn on the workflow rule
-
Test your new configuration
Note: After installing the package or making updates to the workflow rule, remember to Activate the rule so it runs as expected. See the Activate Workflow Rules section to learn how.