renewInsurancePolicy(insurancePolicyProcessInput, policyId)

Renew policy for the specified insurance policy ID.

API Version

63.0

Requires Chatter

No

Signature

public static ConnectApi.InsurancePolicyProcessOutputRepresentation renewInsurancePolicy(ConnectApi.InsurancePolicyRenewInputRepresentation insurancePolicyProcessInput, String policyId)

1ConnectApi.InsuranceBrokerageFamily, renewInsurancePolicy, [ConnectApi.InsurancePolicyRenewInputRepresentation, String], ConnectApi.InsurancePolicyProcessOutputRepresentation

Parameters

insurancePolicyProcessInput
Type: ConnectApi.InsurancePolicyRenewInputRepresentation
Input representation details of the request to renew an insurance policy.
policyId
Type: String
ID of the insurance policy that's to be renewed.

Usage

The Insurance Policy Renewal API takes a JSON input that contains the insurance policy ID that must be renewed along with the fieldValueMap details. The API submits the request to a queue, creates a policy, along with child records by using the context definition selected in setup. The service also overrides the fieldValueMap in the new policy for the policy ID passed in the request. Users receive success and failure notifications on request 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 fieldValueMap expects the keys to be API name and is case-sensitive.

Example

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

1
2global class ConnectDriver {
3         
4    global static void callRenewConnectAPI(){
5        
6        Map<String, Object> input = new Map<String, Object>();
7        input.put('policyId', '0YTxx000000001dGAA');
8        
9        TestConnectAPI callable = new TestConnectAPI();
10        
11        // Create and populate the IssuePolicyInputRepresentation object
12        ConnectApi.InsurancePolicyRenewInputRepresentation policyInput = new ConnectApi.InsurancePolicyRenewInputRepresentation();
13        
14        // Populate fields for InsurancePolicyInputRepresentation
15        Map<String, Object> fields = new Map<String, Object>();
16        fields.put('Name', 'Test Apex');
17        
18        policyInput.fieldValueMap = fields;
19       
20        
21        // Add the policyInput to the input map
22        input.put('policyInput', policyInput);
23        
24        // Prepare the output map
25        Map<String, Object> output = new Map<String, Object>();
26        
27        // Prepare the args map
28        Map<String, Object> args = new Map<String, Object>();
29        args.put('input', input);
30        args.put('output', output);
31        
32        // Call the 'issueInsurancePolicy' action
33        Object result = callable.call('renew', args);
34        // Retrieve the policy data from the result
35        ConnectApi.InsurancePolicyProcessOutputRepresentation policyData = (ConnectApi.InsurancePolicyProcessOutputRepresentation) result;
36        // Output the policy data to the debug log
37        System.debug('Policy Data: ' + JSON.serializePretty(policyData));
38        // Check for errors in the output map
39        if (output.containsKey('error')) {
40            System.debug('Error: ' + output.get('error'));
41		}
42    }
43}