Newer Version Available

This content describes an older version of this product. View Latest

EditClaimCoveragePaymentDetail(EditClaimCoveragePaymentDetailInput, claimId, coverageId, paymentDetailId)

Modify a claim coverage payment detail record.

API Version

66.0

Requires Chatter

No

Signature

public static ConnectApi.EditClaimCoveragePaymentDetailRep EditClaimCoveragePaymentDetail(ConnectApi.EditClaimCvrPaymentDetailInputRep EditClaimCoveragePaymentDetailInput, String claimId, String coverageId, String paymentDetailId)

Parameters

claimId
Type: String
ID of the claim.
coverageId
Type: String
ID of the coverage that applies to the claim.
EditClaimCoveragePaymentDetailInput
Type: ConnectApi.EditClaimCvrPaymentDetailInputRep
Details to edit the claim coverage payment detail.
paymentDetailId
Type: String
ID of the claim coverage payment detail.

Example

Class Definition
This is a sample Apex code to define the EditClaimCoveragePaymentDetail class before you can call it from Apex to edit a claim coverage payment detail.
1
2public with sharing class EditClaimCoveragePaymentDetailCallable implements System.Callable {
3
4    public Object call(String action, Map<String, Object> args) {
5        // Retrieve the input and output maps from the arguments
6        Map<String, Object> inputMap = (Map<String, Object>) args.get('input');
7        Map<String, Object> outputMap = (Map<String, Object>) args.get('output');
8        
9        // Check the action type
10        if (action == 'editClaimCoveragePaymentDetail') {
11            // Retrieve the required parameters from the input map
12            String claimId = (String) inputMap.get('claimId');
13            String claimCoverageId = (String) inputMap.get('claimCoverageId');
14            String paymentDetailId = (String) inputMap.get('paymentDetailId');
15            
16            ConnectApi.EditClaimCvrPaymentDetailInputRep editInputRep = 
17                (ConnectApi.EditClaimCvrPaymentDetailInputRep) inputMap.get('EditClaimCoveragePaymentDetailInput');
18            
19            System.debug('Start of connect API call to edit claim coverage payment detail');
20            System.debug('Claim ID: ' + claimId);
21            System.debug('Claim Coverage ID: ' + claimCoverageId);
22            System.debug('Payment Detail ID: ' + paymentDetailId);
23            
24            // Initialize the output representation
25            ConnectApi.EditClaimCoveragePaymentDetailRep editResponse;
26            
27            // Call the Connect API to edit claim coverage payment detail
28            try {
29                // Call the Connect API resource directly
30                // The endpoint is: /connect/insurance/claims/${claimId}/coverages/${coverageId}/payment-details/${paymentDetailId}
31                editResponse = ConnectApi.InsuranceClaimFamily.EditClaimCoveragePaymentDetail(
32                    editInputRep,
33                    claimId, 
34                    claimCoverageId,
35                    paymentDetailId
36                );
37                
38                System.debug('Edit claim coverage payment detail completed successfully: ' + editResponse);
39                
40                // Put the editResponse in the output map
41                outputMap.put('editResponse', editResponse);
42                outputMap.put('isSuccess', editResponse.isSuccess);
43                
44                // Check if there are any errors
45                if (editResponse.errors != null && !editResponse.errors.isEmpty()) {
46                    outputMap.put('errors', editResponse.errors);
47                    System.debug('Errors found: ' + editResponse.errors);
48                }
49            }
50            catch (Exception e) {
51                System.debug('Error while editing claim coverage payment detail: ' + e.getMessage());
52                outputMap.put('error', e.getMessage());
53                outputMap.put('isSuccess', false);
54            }
55            
56            return editResponse;
57        }
58        
59        // If the action is not recognized, return null
60        return null;
61    }
62}
Usage Example
This example shows how to call the EditClaimCoveragePaymentDetailCallable class and include the required input data.
1PayExGratiaClaimCvrPaymentDetailCallable callable = new PayExGratiaClaimCvrPaymentDetailCallable();
2
3// Prepare the input arguments
4Map<String, Object> input = new Map<String, Object>();
5
6// Set the required parameters
7input.put('claimId', '0ZkSB0000001AVH0A2');                    // Claim ID
8input.put('claimCoverageId', '0kPSB000000GHdu2AG');            // Claim Coverage ID
9input.put('paymentDetailId', '0l2SB000000CLsMYAW');           // Payment Detail ID
10
11// Create the input representation object
12// First create a Map with the properties
13Map<String, Object> payExGratiaInputMap = new Map<String, Object>();
14payExGratiaInputMap.put('reason', 'Customer service goodwill payment');
15
16// Convert the Map to ConnectApi.PayExGratiaClaimCvrPaymentDetailInputRep using JSON.deserialize
17String jsonString = JSON.serialize(payExGratiaInputMap);
18ConnectApi.PayExGratiaClaimCvrPaymentDetailInputRep payExGratiaInputRep = 
19    (ConnectApi.PayExGratiaClaimCvrPaymentDetailInputRep) JSON.deserialize(jsonString, ConnectApi.PayExGratiaClaimCvrPaymentDetailInputRep.class);
20
21input.put('PayExGratiaClaimCvrPaymentDetailInput', payExGratiaInputRep);
22
23// Prepare the output map
24Map<String, Object> output = new Map<String, Object>();
25
26// Prepare the args map
27Map<String, Object> args = new Map<String, Object>();
28args.put('input', input);
29args.put('output', output);
30
31// Call the 'payExGratiaClaimCvrPaymentDetail' action
32Object result = callable.call('payExGratiaClaimCvrPaymentDetail', args);
33
34// Check the result
35if (result != null) {
36    System.debug('payExGratiaClaimCvrPaymentDetail processed successfully: ' + result);
37    
38    // Access the processed payment data
39    ConnectApi.PayExGratiaClaimCvrPaymentDetailRep paymentData = 
40        (ConnectApi.PayExGratiaClaimCvrPaymentDetailRep) result;
41    
42    // Process the result as needed
43    System.debug('Pay Ex Gratia Payment Data: ' + paymentData);
44    
45    // Check if the payment was successful
46    if (paymentData.isSuccess) {
47        System.debug('Pay Ex Gratia was successful');
48        System.debug('Paid Amount: ' + paymentData.paidAmount);
49        System.debug('Claim Payment Summary ID: ' + paymentData.claimPaymentSummaryId);
50        System.debug('Consumed Limit Count: ' + paymentData.consumedLimitCount);
51        System.debug('Exceeded Amount: ' + paymentData.exceededAmount);
52        System.debug('Exceeded Count: ' + paymentData.exceededCount);
53        
54        if (paymentData.insPolicyLimitTrackingIds != null && !paymentData.insPolicyLimitTrackingIds.isEmpty()) {
55            System.debug('Insurance Policy Limit Tracking IDs: ' + paymentData.insPolicyLimitTrackingIds);
56        }
57    } else {
58        System.debug('Pay Ex Gratia failed');
59        if (paymentData.errors != null) {
60            System.debug('Error details: ' + paymentData.errors);
61        }
62    }
63} else {
64    System.debug('Error occurred: ' + output.get('error'));
65}