You are here:
InsPolicyService:createPolicyVersion
Use this service to create a new version of an existing policy, while maintaining the existing policy record as-is.
This service enables policy versioning. All changes to a policy are tracked in different versions of that policy. You can use it in modify policy and cancel policy OmniScripts and Integration Procedures. You can also use this service to reinstate expired and canceled policies.
This service works with the Salesforce Financial Services Cloud for optional Payment Schedule creation support.
How It Works
-
Takes the
assetIdorpolicyIdof the current policy, and the JSON indicated by theinputKey. -
Creates a clone of the original policy.
-
If there's an existing payment schedule, the service updates the payment schedule and creates a payment schedule entry on effective date of endorsement. If
useIsPaidFlagis true, all the future payment schedule entries (from effective date) without transactions (for which the status field isValidandisPaidfield is unchecked) are updated based on newer values of premium, tax, and fee. The new payment schedule entry contains the adjusted values of premium, tax, and fee based on new premiums, taxes, and fees and updated payment schedule entries. Also, the contribution records of policy components in each payment schedule entry are updated. -
The service uses the previous Policy's Premium Calculation Method, Payment Type, and Premium Frequency, and the new Policy's Total Premium For Term, Total Fee For Term, and Total Tax For Term to generate the modified payment schedule. In addition to the creation of the transaction, transaction breakdown data populates into the transaction detail object. This object stores data about how much each asset, participant, or coverage contributes to total transaction amounts in terms of premium, tax, and fees. Only assets, participants, and coverages with at least one value greater than zero for premium, tax, or fees are displayed.
Note Premium Calculation Method, Payment Type, and Premium Frequency aren't copied over from previous policy and must be passed as inputs to the service through the JSON. -
If
includeRevenueScheduleis set to true, it calls revenue schedule service to modify the revenue schedule. -
If it is the first modification of this policy, the service stamps the
originalVersionId__candpreviousVersionId__cwith the sameassetId. If this is not the first modification of this policy, the service carries over theOriginalVersionId__cto the new version and stamps the previousassetIdtoPreviousVersionId__cin the new policy. -
If the
taxesAndFees,taxAmount, and/orfeeAmountnodes are included in the input JSON, the corresponding tax/fee fields and/or records are created and prorated on the new version of the policy. -
If applicable, an InsurancePolicyTransaction will be created for the payment adjustment.
-
If
calculateCommissionistrue, the service callsInsurancePolicyService.calculateAndSaveCommission, which prepares the input for theInsCommissionService.calculateandInsCommissionService.saveCommissionsservices. After the calculate service processes the input, the save service stores the calculated value inTotalCommissionAmount, and then rolls up the value and adds it to theTotalCommissionAmountof the original Policy. - If the
disableAttributeCategoriesflag in thegetquotedetailservice is set to true, the service omits the attributeCategory node from the response and thecreatePolicyVersionservice fails to create policy terms. To make sure that thecreatePolicyVersionservice creates policy terms, set the thedisableAttributeCategoriesflag in the in thegetQuoteDetailservice to false.
Taxes and Fees
Here's how this service works for taxes and fees:
-
If the
taxesAndFeesfield is specified on a JSON record, a correspondingAssetPricingAdjustment__crecord persists for each item in thetaxesAndFeeslist. -
If the
taxAmountfield is specified on a JSON record, theTaxAmount__cfield will be set to the value of thetaxAmountfield on the createdAssetItemobject. -
If the
feeAmountfield is specified on a JSON record, theFeeAmount__cfield will be set to the value of thefeeAmountfield on the createdAssetItem.
As far as the current (newly created policy) is concerned:
-
If the current policy has a
TotalTaxAmount__c, that value is prorated over the effective and end dates and set on theTotalTaxForTerm__cfield. -
If the current policy has a
TotalFeeAmount__c, that value is prorated over the effective and end dates and set on theTotalFeeForTerm__cfield. -
If the
AssetItemon the current policy has aTaxAmount__cthat value is prorated over the effective and end dates and set on theProratedTaxAmount__cfield. -
If the
AssetItemon the current policy has aFeeAmount__cthat value is prorated over the effective and end dates and set on theProratedFeeAmount__cfield.
For policies already created, here's how the taxes and fees are passed around:
-
If the previous policy has a
TotalTaxAmount__c, that value is prorated over the new effective and end dates, and is set on theTotalTaxForTerm__cfield. -
If the previous policy has a
TotalFeeAmount__c, that value is prorated over the new effective and end dates, and is set on theTotalFeeForTerm__cfield. -
If the AssetItem fields have a
TaxAmount__c, then that value is prorated over the new effective and end dates, and is set on theProratedTaxAmount__cfield. -
If the
AssetItemfields on the previous policy have aFeeAmount__c, that value is prorated over the new effective and end dates, and is set on theProratedFeeAmount__cfield.
Finally, if the createTransaction option (see below) is set to true, and the new policy version has associated taxes and fees, the TaxAmount__c and FeeAmount__c fields on the created transaction are set to the difference between the new (current) policy and the previous policy’s TotalTaxForTerm__c and TotalFeeForTerm__c.
Remote Options
Input JSON
This service looks for the inputKey specified within the product JSON.
"policyJson": {
"productConfigurationDetail": {
"insuredItems": {
"Auto": [{
"instanceKey": "2015 Lexus LX250",
"autoLicNum": "Lexus",
"autoModel": "LX150",
"autoYear": 2015,
"BodyClass": "Sedan/Saloon",
"VehicleType": "PASSENGER CAR",
"isPrimary": true
"isParent": true
},
{
"instanceKey": "2006 Honda Odyssey",
"autoLicNum": "Honda",
"autoModel": "Odyssey",
"autoYear": 2006,
"BodyClass": "Minivan",
"VehicleType": "MULTIPURPOSE PASSENGER VEHICLE (MPV)",
"isPrimary": true
"isParent": true
},
{
"instanceKey": "2018 530 BMW",
"autoLicNum": "530",
"autoModel": "BMW",
"autoYear": 2018,
"BodyClass": "Sedan/Saloon",
"VehicleType": "PASSENGER CAR",
"isPrimary": true
"isParent": true
},
{
"instanceKey": "2016 Camry Toyota",
"autoLicNum": "Camry",
"autoModel": "Toyota",
"autoYear": 2016,
"BodyClass": "Sedan/Saloon",
"VehicleType": "PASSENGER CAR",
"isPrimary": true
"isParent": true
}
],
"Driver": [{
"AGE": 20,
"instanceKey": "Joan Smith",
"FN": "Joan",
"GENDER": "Female",
"LN": "Smith",
"isPrimary": false
"isParent": false
},
{
"AGE": 30,
"instanceKey": "John Smith",
"FN": "John",
"GENDER": "Male",
"LN": "Smith",
"isPrimary": false
"isParent": false
},
{
"AGE": 30,
"instanceKey": "Robert Henderson",
"FN": "Robert",
"GENDER": "Male",
"LN": "Henderson",
"isPrimary": false
"isParent": false
},
{
"AGE": 20,
"instanceKey": "Kinsey Schell",
"FN": "Kinsey",
"GENDER": "Female",
"LN": "Schell",
"isPrimary": false
"isParent": false
}
]
},
"accountId": "001f400000RrQSrAAN"
}If the isCreatingPolicyTerms remote option is set to true, a policyTermIds node is included. Here's an example of a policyTermIds node:
{
"policyId": "02i6g000000h110AAA",
"policyTermIds": [
"a5X6g000001LeUUEA0",
"a5X6g000001LeUVEA0",
"a5X6g000001LeUWEA0",
"a5X6g000001LeUXEA0",
"a5X6g000001LeUYEA0",
"a5X6g000001LeUZEA0",
"a5X6g000001LeUaEAK",
"a5X6g000001LeUbEAK",
"a5X6g000001LeUcEAK",
"a5X6g000001LeUdEAK",
"a5X6g000001LeUeEAK",
"a5X6g000001LeUfEAK"
]
}
