Salesforce - Lead Association Events
Contact Association events are required when you know the Opportunity object will be used to fire Conversion Events into Strala.
This event will have four parts:
- The Lead to Strala UUID association
- The Lead to converted Account association
- The Lead to converted Contact association
- The Lead to converted Opportunity association
The Lead Association Events
This will fire an Association Event into JourneyStream that allows us to tie Leads to Strala UUIDs. Without this, we cannot associate a Lead to it's online history.
Start a new process
To create this process, go to Process Automation > Process Builder > New
Name the Process

Add the object
Add Object
to find and select the Lead object. Select
when a record is created or edited
. Under Advanced, check the box that allows for Recursion.

Add Lead has Strala UUID Criteria
Add Criteria
and then name the criteria Lead has Strala UUID. Select
Conditions are met
for the criteria for executing actions. Set two conditions and make sure
All the conditions are met
for the event to fire:
Field | Operator | Type | Value |
[Lead].strala_sys__UUID__c | Is null | Boolean | False |
[Lead].strala_sys__UUID__c | Is changed | Boolean | True |

Set immediate actions for Lead has Strala UUID
Add Action
and name the action Send Association to JourneyStream. Choose the
Post Association to JourneyStream
as the Apex Class and set the following variables and select Save:
Field | Type | Value |
Child ID | Field Reference | [Lead].strala_sys__UUID__c |
Parent ID | Field Reference | [Lead].Id |
Child Type | String | strala_who_uuid |
Parent Type | String | lead_id |

Add Lead Converted to Account Criteria
Field | Operator | Type | Value |
[Lead].ConvertedAccountId | Is null | Boolean | False |
[Lead].ConvertedAccountId | Is changed | Boolean | True |

Set Immediate actions for Lead Converted to Account
Post Association to JourneyStream
as the Apex Class and set the following variables and select Save:
Field | Type | Value |
Child ID | Field Reference | [Lead].ConvertedAccountId |
Parent ID | Field Reference | [Lead].id |
Child Type | String | account_id |
Parent Type | String | lead_id |

Specify what happens to the previous criteria after evaluating the criteria by changing it from Stop the process to Evaluate the next criteria and select Save. This will allow this step to fire even if the previous event fires.
Add Lead Converted to Contact criteria
Add criteria by selecting Add Criteria and then name the criteria Lead Converted to Contact. Select Conditions are met for the criteria for executing actions. Set two conditions and make sure all the conditions are met for the event to fire:
Field | Operator | Type | Value |
[Lead].ConvertedContactId | Is null | Boolean | False |
[Lead].ConvertedContactId | Is changed | Boolean | True |

Set immediate actions for Lead Converted to Contact
Post Association to JourneyStream
as the Apex Class and set the following variables and select Save:
Field | Type | Value |
Child ID | Field Reference | [Lead].ConvertedContactId |
Parent ID | Field Reference | [Lead].id |
Child Type | String | contact_id |
Parent Type | String | lead_id |

Specify what happens to the previous criteria after evaluating the criteria by changing it from Stop the process to Evaluate the next criteria and select Save. This will allow this step to fire even if the previous event fires.
Add Lead Converted to Opportunity criteria
Add criteria by selecting Add Criteria and then name the criteria Lead Converted to Opportunity. Select Conditions are met for the criteria for executing actions. Set two conditions and make sure all the conditions are met for the event to fire:
Field | Operator | Type | Value |
[Lead].ConvertedOpportunityId | Is null | Boolean | False |
[Lead].ConvertedOpportunityId | Is changed | Boolean | True |

Set immediate actions for Lead Converted to Opportunity
Post Association to JourneyStream
as the Apex Class and set the following variables and select Save:
Field | Type | Value |
Child ID | Field Reference | [Lead].ConvertedOpportunityId |
Parent ID | Field Reference | [Lead].id |
Child Type | String | account_id |
Parent Type | String | lead_id |

Specify what happens to the previous criteria after evaluating the criteria by changing it from Stop the process to Evaluate the next criteria and select Save. This will allow this step to fire even if the previous event fires.
Activate the process
Activate the process by selecting the Activate button