bulkRenewInsurancePolicy(insurancePolicyBulkInput)

Renew policies in bulk for the specified Insurance Policy IDs.

API Version

64.0

Requires Chatter

No

Signature

public static ConnectApi.InsurancePolicyBulkOutputRepresentation bulkRenewInsurancePolicy(ConnectApi.InsurancePolicyBulkRenewInputRepresentation insurancePolicyBulkInput)

1ConnectApi.InsuranceBrokerageFamily, bulkRenewInsurancePolicy, [ConnectApi.InsurancePolicyBulkRenewInputRepresentation], ConnectApi.InsurancePolicyBulkOutputRepresentation

Parameters

insurancePolicyBulkInput
Type: ConnectApi.InsurancePolicyBulkRenewInputRepresentation
Input representation of the request to renew insurance policies in bulk.

Usage

Insurance Policy Bulk Renewal API takes a JSON input that contains a list of insurance policy IDs that must be renewed along with the fieldValueMap details. The API submits the request to a queue, creates policies, along with child records by using the context definition selected in setup. The service also overrides the fieldValueMap in the new policy for each policy ID passed in the request. Users receive success and failure notifications on completion.

Keep these considerations in mind when you use this method.

  • The RenewedFromPolicyId value of the new policy is set to the current policy ID and IsRenewedPolicy field of the new policy is set to true.
  • The name of the new policy is a copy of {ExistingName}.
  • The fieldValueMap expects the keys to be API name and is case-sensitive.

Example

This example shows how to call the bulk renew policy API from Apex code.

1
2global class ConnectDriver {
3         
4      global static void callBulkRenewConnectAPI() {
5       Map<String, Object> input = new Map<String, Object>();
6
7       TestConnectAPI callable = new TestConnectAPI();
8
9       ConnectApi.InsurancePolicyBulkInputRepresentation policyInput = new ConnectApi.InsurancePolicyBulkInputRepresentation();
10
11       Map<String, Object> fields = new Map<String, Object>();
12       fields.put('Name', 'Test Apex Bulk');
13       policyInput.fieldValueMap = fields;
14
15       List<String> policyIds = new List<String>();
16       policyIds.add('0YTxx000000001dGAA');
17       policyIds.add('0YTxx000000001dHAA');
18       policyInput.insurancePolicyIds = policyIds;
19
20       input.put('policyInput', policyInput);
21
22       Map<String, Object> output = new Map<String, Object>();
23       Map<String, Object> args = new Map<String, Object>();
24       args.put('input', input);
25       args.put('output', output);
26
27       Object result = callable.call('bulkRenew', args);
28       ConnectApi.InsurancePolicyBulkOutputRepresentation bulkData = (ConnectApi.InsurancePolicyBulkOutputRepresentation) result;
29       System.debug('Bulk Renew Data: ' + JSON.serializePretty(bulkData));
30       if (output.containsKey('error')) {
31           System.debug('Error: ' + output.get('error'));
32       }
33   }
34
35}