Financial Services Cloud Custom Triggers
Custom triggers ensure that data flows correctly through the Financial Services Cloud
custom objects and fields.
Custom triggers use the FinServ namespace prefix. For example, FinServ__AccountTrigger, which is a custom trigger on Account that performs tasks on Account, Contact, and the relationship object AccountAccountRelation.
Trigger Name | Host Object |
---|---|
FinServ__AccountAccountRelationTrigger.trigger | AccountAccountRelation |
FinServ__AccountContactRelationTrigger.trigger | AccountContactRelation |
FinServ__AccountTrigger.trigger | Account |
FinServ__AlertTrigger.trigger | Alert |
FinServ__AssetsAndLiabilitiesTrigger.trigger | AssetsAndLiabilities |
FinServ__ContactContactRelationTrigger.trigger | ContactContactRelation |
FinServ__ContactTrigger.trigger | Contact |
FinServ__EventTrigger.trigger | Event |
FinServ__FinancialAccountRoleTrigger.trigger | FinancialAccountRole |
FinServ__FinancialAccountTrigger.trigger | FinancialAccount |
FinServ__FinancialGoalTrigger.trigger | FinancialGoal |
FinServ__FinancialHoldingTrigger.trigger | FinancialHolding |
FinServ__LeadTrigger.trigger | Lead |
FinServ__OpportunityTrigger.trigger | Opportunity |
FinServ__RBLFilterCriteriaTrigger.trigger | RBLFilterCriteria |
FinServ__ReciprocalRoleTrigger.trigger | ReciprocalRole |
FinServ__RevenueTrigger.trigger | Revenue |
FinServ__RollupByLookupConfigTrigger.trigger | RollupByLookupConfig |
FinServ__SecuritiesTrigger.trigger | Securities |
FinServ__TaskTrigger.trigger | Task |
FinServ__InsurancePolicyTrigger.trigger | InsurancePolicy |
FinServ__ClaimTrigger.trigger | Claim |
Trigger Behavior
The package provides triggers on sObjects, Relation sObjects, and Rollup sObjects. Each object type’s trigger checks for various conditions and then performs tasks based on what it finds. Each object has one trigger. The following list explains trigger behavior by object.
sObjects
- Account
- Before insert: If the record type indicates that the account isn’t a portion of an individual, IndividualType is set to blank.
- After insert: If the user creates an account of record type Individual, create an individual contact linked to the account. Also assigns topics based on the value in the field after an account has been created.
- The steps to create an individual contact and assign topics are:
- For each account created, creates a contact.
- For each contact, adds AccountId.
- For each account, in a future method, adds ContactId.
- Sets IndividualId__c to AccountId concatenated with the current date.
-
Before update: Validates that the update on the account:
- Hasn’t changed the account’s record type from individual to another record type, and hasn’t changed from one individual record type to another.
- Hasn’t changed the account’s record type from another record type to an individual record type.
-
After update: Syncs the contact associated with the updated account to reflect
the updated fields. The following fields are synced:
- AccountName
- OwnerId
- IndividualType__c
- RecordTypeId
- Before delete: Helps perform cascade deletes. Gathers all the rollup objects related to the account to be deleted.
- After delete: Rolls back the rollup objects related to the deleted account.
- Contact
-
Before insert: Creates an individual (Account - Representing Party) when the
individual contact is promoted as an individual as follows.
- For each account that is passed, creates a contact.
- For each contact, adds AccountId.
- For each account, in a future method, adds ContactId.
- Sets IndividualId__c to AccountId concatenated with the current datetime.
- After insert: Validates that the referenced individual account does not have a contact associated with it. This check is bypassed during a lead conversion.
-
Before update: Validates that the update on the account record:
- Hasn’t changed the record type of the account from individual to another record type.
- Hasn’t changed the record type of the account from any other record type to an individual.
- Validates that the referenced individual account does not have a contact associated with it.
-
After update: Syncs the account associated with the updated contact to reflect
the updated fields. The following fields are synced:
- AccountName
- OwnerId
- IndividualType__c
- RecordTypeId
- Reciprocal Role
- After insert: If the role has the flag to create a reciprocal role set, creates a Reciprocal Role sObject for the inverse role.
- Before delete: Where there is an inverse Reciprocal Role sObject record, delete that record.
- RollupByLookupConfig
-
Before insert: Validates each new RollupByLookupConfig object according to
these rules:
- Can’t insert a duplicate RollupByLookupConfig object. Duplicate records are those that share combination of ToObject__c, ToField__c, and LookupField__c.
- Can’t exceed 40 active RollupByLookupConfig objects.
- The fields and lookups on the RollupByLookupConfig object must be valid.
- The Where Clause field must contain a correctly formatted SQL expression.
- Before update: Performs the same actions as before insert.
- Before delete: Validates that the RollupByLookupConfig object isn’t active (active objects can’t be deleted).
- RBLFilterCriteria
-
Before insert: Validates each new RBLFilterCriteria object according to these
rules:
- A RBLFilterCriteria object can’t be inserted when its parent is active.
- The fields on the RBLFilterCriteria object must be valid.
- The Operator must be valid ('greater than', 'equals', 'greater than or equals to', 'contains', 'not equal to', 'less than', 'less than or equal to', 'not contains', 'not like', 'starts with', 'ends with', 'in').
- Before update: Performs the same actions as before insert.
- Before delete: Validates that the RBLFilterCriteria object’s parent RollupByLookupConfig object isn’t active (RBLFilterCriteria objects with an active parent RollupByLookupConfig object can’t be deleted).
Relation sObjects
- AccountContactRelation (ACR)
-
Before insert: Populates RecordTypeId and
Date for each ACR record to be inserted. Ensures that each ACR
obeys these requirements:
- No multiple primary members for a given household.
- Contact portion can’t be a member of multiple households.
- No multiple ACR records with the same AccountId and ContactId combination.
- After insert: Recalculates the rollups for all groups in which member or business ACRs have changed.
- Before update: Performs the same actions as before insert.
- After update: Performs the same actions as after insert.
- Before delete: Ensures that none of the ACRs to be deleted are of the record type Group. Also recalculates rollups for all groups when any member or business ACRs have changed.
- AccountAccountRelation (AAR)
- After insert: If the auto-create inverse setting is selected, create the inverse record.
- Before update: Checks to see if records are being deactivated. If so, sets EndDate__c as the day of the update, and if the auto-create inverse setting is selected deactivates the inverse record.
- Before delete: If the auto-create inverse setting is selected, delete the inverse record of the AAR.
- ContactContactRelation (CCR)
- After insert: If the auto-create inverse setting is selected, creates the inverse record.
- Before update: If records are being deactivated, sets EndDate__c as today, and if the auto-create inverse setting is selected deactivates the inverse record.
- Before delete: If the auto-create inverse setting is selected, deletes the inverse record of the CCR.
Rollup sObjects
- Financial Account
- Before insert: Sets the value of the owner type when a FinancialAccount record is updated. Then sets Household__c to the account portion of the group that it’s rolling up to.
-
After insert:
- Creates a primary owner financial account role for the new financial account.
- If defined, creates joint owner roles and user-selected roles.
- Performs the rollup calculation.
- Before update: Performs the same actions as before insert.
- After update: Performs the same actions as after insert.
- Before delete: Deactivates all Financial Account Roles related to the Financial Account by performing an UPDATE to set Active value to False.
- After delete: Performs the rollup calculation.
- Financial Account Role (FAR)
- Before insert: If RelatedContact__c of the FAR record is associated with an individual account, updates RelatedAccount__c to that of the individual account.
- After insert: For FAR records of type Joint Owner, updates the Joint Owner field on the associated Financial Account record, then performs the rollup calculations.
- Before update: Performs the same actions as before insert and, if the user has chosen to deactivate the FAR records, sets the end day to the current day.
- After update: Performs the rollup calculations.
- Before delete: Blocks the deletion of any FAR records of type Primary Owner. FAR records of type Primary Owner must be deleted from the associated Financial Account record. For FAR records of type Joint Owner, updates the Joint Owner field on the associated Financial Account record.
- After delete: Performs the rollup calculations.
- Assets and Liabilities
- Before insert: Sets Household__c to the account portion of the group that it’s rolling up to.
- Before update: Performs the same action as before insert.
- Financial Goals
- Before insert: Sets Household__c of the FinancialGoal record to the account portion of the group that the financial goal is rolling up to.
- Before update: Performs the same action as before insert.
- Financial Holdings
- Before insert: Retrieves financial account fields based on the FinancialHolding record and then populates Household__c and PrimaryOwner on the financial holding to be inserted.
- Revenue
- After insert: Performs the rollup calculations.
- After update: Performs the rollup calculations.
- After delete: Performs the rollup calculations.
- Tasks
- Before insert: Sets Household__c of the Task record to the account portion of the group that the task is rolling up to.
- After insert: Updates the Next and Last interaction for the Contact that is associated with the task.
- Before update: Performs the same action as before insert.
- After update: Performs the same action as after insert.
- After delete: Performs the same action as after insert.
- Events
- Before insert: Sets Household__c of the Event record to the account portion of the group that the event is rolling up to.
- After insert: Updates the Next and Last interaction for the Contact that is related to the event.
- Before update: Performs the same action as before insert.
- After update: Performs the same action as after insert.
- After delete: Performs the same action as after insert.
- Leads
- Before insert: For individual data models only, this trigger maps the lead name to the company name field and updates the company name to the employer field for leads converted into individuals. It also checks and performs household rollup for referrals and stamps the ReferredByContact__con the Lead object.
- After insert: Updates the Next and Last interaction for the Contact that is related to the event.
- Before update: For the individual data model, this trigger maps the lead name to the company name field and updates the employer field for leads converted into individuals. It validates data to ensure that Referral-mapped type Lead records are not associated with non-individuals and restricts mixed Account and Contact individual and non-individual record types. It also prevents any lead with expressed interest from being converted to a new individual. Additionally, it checks and performs household rollup for referrals and stamps the ReferredByContact__c field on the Lead object.
- After update: Ensures that the lead-converted contact is set as the primary contact on the account and that the opportunity linked to the lead is updated with the appropriate record type. After the lead is converted, it updates the converted accounts with the referred-by values from the lead. Additionally, it calculates and updates referral scores for the contact.
- Opportunities
- Before insert: Sets Household__c of the Opportunity record to the account portion of the group that the opportunity is rolling up to.
- Before update: Performs the same action as before insert.
- Insurance Policy
- Before insert: Sets Household__c of the Insurance Policy record to the account portion of the household that the insurance policy is rolling up to.
- Before update: Performs the same action as before insert.
- Claim
- Before insert: Sets Household__c of the Claim record to the account portion of the household that the claim is rolling up to.
- Before update: Performs the same action as before insert.