Endorse policies in bulk for the specified insurance policy IDs.
API Version
67.0
Requires Chatter
No
Signature
public static ConnectApi.InsurancePolicyBulkOutputRepresentation bulkEndorseInsurancePolicy(ConnectApi.InsurancePolicyBulkInputRepresentation insurancePolicyBulkInput)
Input representation of the request to endorse policies in bulk. The JSON input includes a field value map of insurance policy fields and a list of insurance policy IDs to endorse.
Use this method to endorse insurance policies in bulk. The JSON input includes a field value map of insurance policy fields and a list of insurance policy IDs. After the request is successfully sent to the message queue, policies are endorsed asynchronously, and you receive either a success or failure notification after the completion of the request.
Example
The Apex example shows how to use the ConnectApi.InsuranceBrokerageFamily.bulkEndorseInsurancePolicy() method to endorse multiple insurance policies in bulk.
Class Definition
This Apex example shows how to endorse multiple policies in bulk.
1global class BulkEndorseConnectDriver{23 global static void callBulkEndorseConnectAPI(){4 Map<String, Object>input = new Map<String, Object>();56 ConnectApi.InsurancePolicyBulkInputRepresentation bulkInput = new ConnectApi.InsurancePolicyBulkInputRepresentation();78 List<String>policyIds = new List<String>{9 '0YTxx000000001dGAA',10 '0YTxx000000002dGAA',11 '0YTxx000000003dGAA'12};13 bulkInput.insurancePolicyIds = policyIds;1415 input.put('bulkInput', bulkInput);1617 Map<String, Object>output = new Map<String, Object>();18 Map<String, Object>args = new Map<String, Object>();19 args.put('input', input);20 args.put('output', output);2122 BulkEndorseTestConnectAPI callable = new BulkEndorseTestConnectAPI();23 Object result = callable.call('bulkEndorse', args);2425 ConnectApi.InsurancePolicyBulkOutputRepresentation bulkData =26(ConnectApi.InsurancePolicyBulkOutputRepresentation)result;27 System.debug('Bulk Endorse Data: ' + JSON.serializePretty(bulkData));2829 if(output.containsKey('error')){30 System.debug('Error: ' + output.get('error'));31}32}33}
Usage Example
Use the BulkEndorseTestConnectAPI class to execute the bulkEndorse action and process the result.