You are here:
Apex Triggers for Insurance
A trigger is Apex code that runs before or after a specific data manipulation language (DML) event occurs, such as before the insertion or after the deletion of records in a database. Salesforce stores triggers as metadata. By modifying Salesforce custom settings, you can enable and disable Insurance Apex triggers as required by your implementation.
See Enabling and Disabling Vlocity Apex Triggers to learn how.
Trigger Details
Object |
Trigger Name |
Trigger Handler Name |
Default On/Off |
|---|---|---|---|
Contact |
Party.EnablePartyModel |
Off |
|
Producer.EnableAutoRelationship |
Off |
||
ContentDocumentLink |
ContentDocumentLink.ShareProductImage |
Off |
|
Policy (Asset) |
N/A: This trigger uses Insurance Configuration Custom Settings. |
N/A |
|
Product2 |
InsuranceProductTrigger |
On |
InsuranceContact
The InsuranceContact trigger supports Party Model relationships.
How it works:
If an Account has the record type of AgencyBrokerage, and this Contact has the Producer record type, then a Party relationship is automatically created.
The Party.EnablePartyModel and Producer.EnableAutoRelationship trigger handlers are off by default. The InsuranceContact trigger is only on when both trigger handlers are on.
ContentDocumentLink
The ContentDocumentLink trigger supports product image sharing.
How it works:
If you upload a content document for a product, and the document title starts with “prodImage_” and its visibility is not set to AllUsers, then automatically set it to AllUsers.
PolicyAsset
The PolicyAsset trigger supports the automatic creation of the policyholder relationship in a contact center use case. This trigger uses Insurance Configuration Custom Settings rather than a Trigger Setup Custom Setting to turn it on or off.
How it works:
When an Asset is inserted, you automatically create an AssetPartyRelationship record for it if it meets the following criteria:
-
The Asset's Record Type matches one of the Types specified in the PolicyRecordTypes custom setting.
-
A field specified in either AccountFieldPolicyRoles or ContactFieldPolicyRoles is populated
-
The Relationship Type is available.
If an Asset is updated, you automatically create an AssetPartyRelationship record for it if it meets the following criteria:
-
The Asset's Record Type matches one of the Types specified in the PolicyRecordTypes custom setting.
-
A field specified in either AccountFieldPolicyRoles or ContactFieldPolicyRoles is populated that was null previously.
-
The Relationship Type is available.
See Creating the PolicyAsset Trigger Insurance Configuration Custom Settings to learn how to enable the Insurance Configuration Custom Settings required for this trigger.
InsuranceProduct
The InsuranceProduct trigger supports Product Class Plan Renewal (to ensure that the replacementProductId is set when you retire a product), and Benefit Catalog Change tracking.
How it works:
Create/update PriceBookEntry based on StandardPremium__c.
RatingCalcProcedureName__c is populated from the parent product's Product Class if it is empty.
ReplacementProductId__c is required if EnrollmentStatus__c is set to Retired or Inactive.
If the EligibilityCriteria__c, EligibilityCriteriaComments__c, or HelpText__c fields are changed, creates a new ProductConfigurationChangeLog__c record to capture the change.
In addition to the InsuranceProductTrigger, you also need to enable an Insurance Configuration Setup Custom Setting to turn on this trigger. See Creating the InsuranceProduct Trigger Insurance Configuration Custom Setting to learn how.

