Skip to content

The Opportunity Key

Kara McIntyre edited this page May 31, 2019 · 3 revisions

Like Affiliation Key, the Opportunity Key field on Interactions and Opportunities and the Opportunity Key Workflow Rule work together to control how the Interactions code matches on and updates Opportunities. For a full explanation of the Opportunity Key and how to fit it into your recruitment model, see “Opportunities for Recruitment” in the User Guide. For a more technical explanation of how the Interaction’s code uses Opportunity Keys, see “Matching with Opportunity Key” in the Technical Implementation Guide.

The Opportunity Key Out-of-the-Box

The Opportunity Key formula field on Interactions along with a workflow rule and field update allow the Interactions process to match on Opportunities for both a centralized (one Opportunity per Career and Term) and decentralized (one Opportunity per Career, Interest, and Term) recruitment model.

Opportunity Key Formula Field on Interactions

If the Career field on the associated Academic Interest (or Recruitment Interest if Academic Interest is blank) is Undergraduate, the Opportunity Key field will use the following information to match to an Opportunity record:

Contact.Id + . + Undergraduate + . + Term.Id

If the Career field on the associated Academic Interest (or Recruitment Interest if Academic Interest is blank) is Graduate, the Opportunity Key field will use the following information:

Contact.Id + . + Undergraduate + . + Academic Interest.Id (or Recruitment Interest.Id if Academic Interest is blank) + . + Term.Id

If this setup matches your recruitment business processes, there is no need to make changes to the key.

Activating Opportunity Key Update Workflow

The Opportunity: Update Opportunity Key workflow rule runs every time an Opportunity record is edited and the Opportunity Key field is not equal to the expected value based on the Career field on the Academic Interest (or Recruitment Interest if Academic Interest is blank). This is important if your organization allows users to update or create Opportunities outside the Interactions process.

The Opportunity Key

You will need to activate this rule after installing the package:

  1. Go to Setup > Process Automation > Workflow Actions > Workflow Rules
  2. Open the “Opportunity: Update Opportunity Key” workflow rule by clicking on the name
  3. Click the Activate button

Updating Opportunity Key and Workflow

If the keys provided out-of-the-box do not represent unique Opportunities for your Undergraduate or Graduate recruitment processes, you will need to update the Opportunity Key formula field on Interactions and the Opportunity: Update Opportunity Key workflow rule and field update.

For example, if your university does not plan to recruit for Graduate programs in Salesforce, you will need to update the key.

Follow these steps to use only the centralized process and ignore Career:

  1. Go to Setup > Object Manager > Interaction > Fields and Relationships
  2. Edit the “Opportunity Key” formula field
  3. The new key should be as follows (comments are surrounded by /* */ and not necessary for the functionality of the formula)

/*The below formula allows for a decentralized recruitment model.*/

/*If both Academic Interest and Recruitment Interest are blank, the formula is blank, which means the record is missing important information and no Opportunity will be created.*/

IF(Academic_Interest__c + Recruitment_Interest__c = "", "", "."+CASESAFEID(Term__r.Id))

  1. After saving the formula changes, go to Setup > Process Automation > Workflow Actions > Workflow Rules

  2. Edit the Opportunity: Update Opportunity Key Workflow Rule to match the 18-digit Contact ID followed by the Opportunity Key from step 3

    Opportunity_Key__c <> CASESAFEID(Contact__r.Id) + "."+ CASESAFEID(Term__r.Id)

  3. After saving the workflow rule changes, go to Setup > Process Automation > Workflow Actions > Field Updates

  4. Edit the “Opportunity Key: Set Based on Career” Field Update

  5. Change the name of the update rule if needed (example: “Opportunity Key: Set to Contact + Term”)

  6. Set the formula to match the 18-digit Contact ID followed by the Opportunity Key from step 3

    CASESAFEID(Contact__r.Id) + "."+ CASESAFEID(Term__r.Id)

  7. Click Save and make sure the associated workflow rule is Active

Clone this wiki locally