postInsuranceGroupEndorsement(censusId, insuranceGroupEndorsementInputRepresentation)
API Version
68.0
Requires Chatter
No
Signature
public static ConnectApi.InsuranceGroupEndorsementRepresentation postInsuranceGroupEndorsement(String censusId, ConnectApi.InsuranceGroupEndorsementInputRepresentation insuranceGroupEndorsementInputRepresentation)
Parameters
- censusId
- Type: String
- ID of the group census whose eligible member policies are updated based on the contract mid-term adjustment.
- insuranceGroupEndorsementInputRepresentation
- Type: ConnectApi.InsuranceGroupEndorsementInputRepresentation
- Optional flow and repricing settings that are used to apply the contract adjustments to member policies.
Return Value
Usage
Use this method to apply mid-term contract adjustments to the eligible member policies in a group census. Specify the census in censusId. All properties on the input representation are optional.
To use a custom flow, set flowName to the flow's API name. If you omit flowName, the method uses ind_ins_grpben__ApplyCntrAdjMbrPlcy. Set shouldReprice to false to keep the premiums from the existing GroupCensusMemberPlan records instead of recalculating them. The default value is true.
The census upload must be finished before you apply the adjustment. The method runs asynchronously. Use the requestId in the response to track the job. Errors that occur while validating or scheduling the job are in the errors property.
Example
This example applies mid-term contract adjustments to the eligible member policies in a group census and recalculates premiums. Complete the census upload before you run this method.
1// Apply mid-term contract adjustments to eligible member policies.
2// The census upload must be finished before adjusting.
3
4final String CENSUS_ID = '0rfxx000000022IAAQ';
5
6ConnectApi.InsuranceGroupEndorsementInputRepresentation input =
7 new ConnectApi.InsuranceGroupEndorsementInputRepresentation();
8input.shouldReprice = true;
9// input.flowName = 'ind_ins_grpben__ApplyCntrAdjMbrPlcy'; // optional; omit to use the default flow
10
11try {
12 ConnectApi.InsuranceGroupEndorsementRepresentation result =
13 ConnectApi.GroupBenefitsApi.postInsuranceGroupEndorsement(CENSUS_ID, input);
14
15 System.debug('requestId: ' + result.requestId);
16 System.debug('errors: ' + result.errors);
17} catch (Exception e) {
18 System.debug('Error while applying contract adjustments: ' + e.getMessage());
19}This example uses the default flow and the default repricing behavior (shouldReprice is true).
1// Apply mid-term contract adjustments with defaults: default flow, shouldReprice = true.
2
3final String CENSUS_ID = '0rfxx000000022IAAQ';
4
5ConnectApi.InsuranceGroupEndorsementInputRepresentation input =
6 new ConnectApi.InsuranceGroupEndorsementInputRepresentation();
7
8try {
9 ConnectApi.InsuranceGroupEndorsementRepresentation result =
10 ConnectApi.GroupBenefitsApi.postInsuranceGroupEndorsement(CENSUS_ID, input);
11
12 System.debug('requestId: ' + result.requestId);
13 System.debug('errors: ' + result.errors);
14} catch (Exception e) {
15 System.debug('Error while applying contract adjustments: ' + e.getMessage());
16}