Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
reinstateInsurancePolicy(insurancePolicyReinstatementInput, policyId)
API Version
67.0
Requires Chatter
No
Signature
public static ConnectApi.InsurancePolicyReinstatementRepresentation reinstateInsurancePolicy(ConnectApi.InsurancePolicyReinstatementInputRepresentation insurancePolicyReinstatementInput, String policyId)
1ConnectApi.InsuranceBrokerageFamily, reinstateInsurancePolicy, [ConnectApi.InsurancePolicyReinstatementInputRepresentation, String], ConnectApi.InsurancePolicyReinstatementRepresentationParameters
- insurancePolicyReinstatementInput
- Type: ConnectApi.InsurancePolicyReinstatementInputRepresentation
- Input representation containing the insurance policy field overrides and the reinstatement date.
- policyId
- Type: String
- ID of the insurance policy to reinstate.
Return Value
Usage
Use this method to reinstate a previously canceled insurance policy. Provide the reinstatement date and any policy field overrides in the input representation, along with the ID of the policy to reinstate. The response includes the reinstated policy ID, the transaction ID, and any errors.
Example
The Apex example shows how to use the ConnectApi.InsuranceBrokerageFamily.reinstateInsurancePolicy() method to reinstate a previously canceled insurance policy.
- Class Definition
- This Apex example shows how to reinstate a canceled insurance policy.
-
1global class ReinstateConnectDriver { 2 3 global static void callReinstateConnectAPI() { 4 Map<String, Object> input = new Map<String, Object>(); 5 input.put('policyId', '0YTxx000000001dGAA'); 6 7 ConnectApi.InsurancePolicyReinstatementInputRepresentation reinstateInput = new ConnectApi.InsurancePolicyReinstatementInputRepresentation(); 8 reinstateInput.reinstatementDate = '2026-01-15'; 9 10 ConnectApi.InsurancePolicyInputRepresentation policyInput = new ConnectApi.InsurancePolicyInputRepresentation(); 11 Map<String, Object> fields = new Map<String, Object>(); 12 fields.put('Status', 'Active'); 13 policyInput.fieldValueMap = fields; 14 reinstateInput.insurancePolicy = policyInput; 15 16 input.put('policyInput', reinstateInput); 17 18 Map<String, Object> output = new Map<String, Object>(); 19 Map<String, Object> args = new Map<String, Object>(); 20 args.put('input', input); 21 args.put('output', output); 22 23 ReinstateTestConnectAPI callable = new ReinstateTestConnectAPI(); 24 Object result = callable.call('reinstate', args); 25 26 ConnectApi.InsurancePolicyReinstatementRepresentation policyData = 27 (ConnectApi.InsurancePolicyReinstatementRepresentation) result; 28 System.debug('Reinstate Policy Data: ' + JSON.serializePretty(policyData)); 29 30 if (output.containsKey('error')) { 31 System.debug('Error: ' + output.get('error')); 32 } 33 } 34} - Usage Example
- Use the ReinstateTestConnectAPI class to execute the reinstate action and process the result.
-
1public class ReinstateTestConnectAPI implements System.Callable { 2 3 public Object call(String action, Map<String, Object> args) { 4 Map<String, Object> inputMap = (Map<String, Object>) args.get('input'); 5 Map<String, Object> outputMap = (Map<String, Object>) args.get('output'); 6 7 if (action == 'reinstate') { 8 ConnectApi.InsurancePolicyReinstatementInputRepresentation reinstateInput = 9 (ConnectApi.InsurancePolicyReinstatementInputRepresentation) inputMap.get('policyInput'); 10 String policyId = (String) inputMap.get('policyId'); 11 System.debug('Start of Connect API call to reinstate policy: ' + policyId); 12 13 ConnectApi.InsurancePolicyReinstatementRepresentation policyData; 14 try { 15 policyData = ConnectApi.InsuranceBrokerageFamily.reinstateInsurancePolicy(reinstateInput, policyId); 16 System.debug('Policy reinstated successfully: ' + policyData); 17 outputMap.put('policyData', policyData); 18 } catch (Exception e) { 19 System.debug('Error while reinstating policy: ' + e.getMessage()); 20 outputMap.put('error', e.getMessage()); 21 } 22 return policyData; 23 } 24 25 return null; 26 } 27} 28 29// Execute 30ReinstateConnectDriver.callReinstateConnectAPI();