Delete the specified plans for a group census member.
API Version
65.0
Requires Chatter
No
Signature
public static ConnectApi.InsuranceDeleteMemberPlansOutputRepresentation postInsuranceDeleteMemberPlans(ConnectApi.InsuranceDeleteMemberPlansInputRepresentation insuranceDeleteMemberPlansInputRepresentation, String memberId)
Parameters
insuranceDeleteMemberPlansInputRepresentation
- Type: ConnectApi.InsuranceDeleteMemberPlansInputRepresentation
- The input representation containing the list of plans to delete.
memberId
- Type: String
- ID of the group census member whose plans are being deleted.
Return Value
Type: ConnectApi.InsuranceDeleteMemberPlansOutputRepresentation
Example
Here's an example of how to invoke the Insurance Delete Member Plans API from Apex code.
// Delete Member Plan(s) for a Group Census Member via Connect API (simple version) // 1) Create the top-level input ConnectApi.InsuranceDeleteMemberPlansInputRepresentation input = new ConnectApi.InsuranceDeleteMemberPlansInputRepresentation(); // 2) Provide the list of existing Group Census Member Plan record Ids to delete // Uses a simple string list wrapper List<String> planIdsToDelete = new List<String>{ '0rgxx000000003LAAQ', '0rgxx000000003UAAQ' }; input.plans = planIdsToDelete; // 3) Execute the POST Delete Member Plans API // URL param is the Group Census Member Id whose plans you want to delete String memberId = '0r6xx00000004LGAAY'; try { ConnectApi.InsuranceDeleteMemberPlansOutputRepresentation result = ConnectApi.InsuranceGroupBenefitsFamily.postInsuranceDeleteMemberPlans(input, memberId); System.debug('Delete Member Plans result: ' + JSON.serializePretty(result)); } catch (Exception e) { System.debug('Error while deleting member plans: ' + e.getMessage()); }